sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
56ddc4af4bf8bcb7d278742f7a94b273ab57eb7544da497fcc63c117030e204d
MATLAB
7,451
191
function [hx, hy, hz] = ft_plot_ortho(dat, varargin) % FT_PLOT_ORTHO plots 3 orthographic cuts through a 3-D volume and interpolates if needed % % Use as % ft_plot_ortho(dat, ...) % or % ft_plot_ortho(dat, mask, ...) % where dat and mask are equal-sized 3-D arrays. % % Additional options should be specified in key...
e0f10f99b4b911c3730b7af2b9ba74ccbd269d0de3f3f9230edf192abf3a3230
MATLAB
7,453
128
%% 共空间模式 | common spatial patterns (CSP) 不可在main中调用,仅可单独使用 %% one vs rest Multiclass or two-classes 目标函数法 % how:N个类别得到N个投影矩阵,对每个投影矩阵取最佳的2m个方向(前后各m个),特征矩阵为2m*N维 % 优点:N类需要计算N个投影矩阵,即使N很大,计算量也不会很大 % 缺点:由于rest类别是混合类别,内部特征并不统一,因此很难找出最优的投影方向,即结果可能并不是最优的 % 注意:在计算CSP投影矩阵时,并非使用整个trial,而是将trial划分出若干segments, % 对每个segments提取CS...
bd2e8829c7d6a3c0ba971b0c63bea37b98fc071146854d3a4e8fb58c8b4e793d
MATLAB
7,457
240
function [Mean_MMT_Elbow_Wrist] = Muscle_Moment_G5(x) % MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % This script computes the maximum muscle moment averaged over the cycle as a fu...
948f9a663f5f3bc789ae42c06b3665b1707f511d3baf3cde7d6673a130fa31ce
MATLAB
7,458
291
function draw_figure3ABC_S1C(p,decRes) % % This code is for drawing figure 3ABC and S1C % % %% settings compPairs = {'category','dimension'}; % roi parameters hcpIdx = ~cellfun(@isempty,strfind(p.roiDescrip,'hcp180')); subIdx = ismember(p.roiDescrip,{'thalamus','hyppocampus','hypothalamus','pallidum','brainstem','caud...
c5edc88358f775e213e153c0f5cdb7971a7adf3cddf924cc2e516b2a2da1d4f5
MATLAB
7,458
191
function [ReHoBrain_AllWindow, GHeader] = y_reho_Surf_Window(WindowSize, WindowStep, WindowType,InFile, NNeighbor, AMaskFilename, AResultFilename, SurfFile, IsNeedDetrend, CUTNUMBER) % Calculate dynamic regional homogeneity (i.e. ReHo) from the 2D surface brain % FORMAT [ReHoBrain_AllWindow, GHeader] = y_reho_Sur...
0e247e5803381571b3c020211a64d340cd941e6c39d4d0e80b8a72d0014f4045
MATLAB
7,460
175
function h_finalizeSpineAssigment3(handles) global h_img3; [currentInd2, handles2, currentStruct2, currentStructName2] = h_getCurrendInd3(handles);% "2" is "Current" structNames = fieldnames(h_img3); for i = 1:length(structNames) if ~strcmpi(structNames{i}, currentStructName2) && ~strcmpi(structNames{i...
dc17a83528728c6a2b83e13649f9e1c6d10d23c155382fdb163f2d269ad93b8d
MATLAB
7,460
143
classdef CBIG_AuthorTopicEM_unit_test < matlab.unittest.TestCase % CBIG_AuthorTopicEM_UnitTest % % Wrapper function to unit-test a coordinate-based meta-analysis with % the author-topic model and expectation-maximization (EM) algorithm. % The inference was performed with the following hard-coded hyperparamete...
5b0da1afa3193be184a4feb355416b47d2e8a996887eddf37440d2d0fe9a39e8
MATLAB
7,465
136
function [stat, cfg] = ft_statistics_analytic(cfg, dat, design) % FT_STATISTICS_ANALYTIC performs a parametric statistical test on the % data, based on a known (i.e. analytic) distribution of the test % statistic. This function should not be called directly, instead % you should call the function that is associated wi...
819ee3b752098fa0055753f49f13c729f60e64d8211094f6435499f08a59e174
MATLAB
7,467
189
classdef ImarisReader < matlab.mixin.SetGet & dynamicprops % ImarisReader Imaris ims file reader class % % Syntax % ------ % obj = ImarisReader(filepath) % % Description % ----------- % obj = ImarisReader(filepath) creates an ImarisReader object obj to % r...
65049661bc392f0c88ac481cb9b0a0cf2f4464ae8dddca6aba3f8afd13b36ae8
MATLAB
7,470
230
% DELCODE-SAME, Figure "FADE SAME ApoE" % _ % original paper: Soch*, Richter* et al., HBM, 2022 % Figure S3: Analysis of FADE scores as a function of ApoE genotype % % DELCODE paper: Soch et al., medRxiv, 2023 % Figure 4: FADE and SAME scores by diagnostic group and ApoE genotype % % written by Joram Soch <Joram.So...
094aaabf5eec750501d741f50a7513284248a5461bc29d4034b58d552faf0d06
MATLAB
7,475
202
function ft_plot_montage(dat, varargin) % FT_PLOT_MONTAGE makes a montage of a 3-D array by selecting slices at regular distances % and combining them in one large 2-D image. Note that the montage of MRI slices is not to % be confused with the EEG montage, which is a way of specifying the reference scheme % between e...
6fd54f621727b50f2ecc76a30cf3432aa2c9b2676b710a02fb46f4bb110d99f2
MATLAB
7,475
296
function [hfigs,savenames,errprctiles] = PlotPerLandmarkErrorPrctilesOverX(varargin) [errprctiles,gtdata,nets,legendnames,colors,colorfracprcs,exptype,... n_train,... conddata,labeltypes,datatypes,... maxerr,prcs,... pttypes,... hfigs,figpos,savedir,savenames,dosavefig,xl,savekey] = myparse(varargin,'errprct...
e5f0ca70966f8452e7a62abe903dba2444fa469ef48d7371ab26968c182c886c
MATLAB
7,476
196
function [] = makeProbeMap(folder,varargin) %% this function takes an xml file with spike groups already assigned and %% generates *.prb files for each shank for spike detection/masking/clustering %% IMPORTANT: this function ASSUMES that the order of the channels for each shank %% in the spike groups map onto a specif...
f7adff7b607fc080e92b63def54cb78b81cfe1b2dda07d71da0750f32f36cb7f
MATLAB
7,476
164
%% Light Level Calibration Workflow Example (https://elifesciences.org/reviewed-preprints/93795v2) % IMPORTANT NOTE: This script is an example of the workflow for % and isomerization rate calculation. You will need to modify certain values % (especially calibration values and file paths) based on your own devices, ...
83246f6ea545f97e55f0ac85606639937df09fb8840494bdabc07d0f38b3f0d5
MATLAB
7,480
213
%% Enrichment and Mcnemar % This code runs enrichment on 2 independent groups. % McNemar chi-square is used to compare network pairs between groups. %% Load data % load IM structure load('filepath to IM structure'); % load connectivity data group1fc = load('filepath to group 1 fc data'); group2fc = load...
86b84117d289b0130969db0660f9c57d73e3a12560a397a7d59aea0abb70fd7d
MATLAB
7,480
178
function [Allobject_container, SHGMask_container, CellMask_container, PixelRatio8o7, Overlapped8o7, ... Cell755, Cell860] = generate_masks_SeparateMasks(roi_names, ... file_identifiers, image_array, filtersize, prctile_thr, Masks) if nargin < 6 Masks = 0; elseif nargin < 4 Masks = 0; prctile_thr = ...
b0b433037eb262bb439ff9a2d4ba34933fd7dcd270c43b341e5dc9a2863370f5
MATLAB
7,484
232
function varargout = montage2( IS, prm ) % Used to display collections of images and videos. % % Improved version of montage, with more control over display. % NOTE: Can convert between MxNxT and MxNx3xT image stack via: % I = repmat( I, [1,1,1,3] ); I = permute(I, [1,2,4,3] ); % % USAGE % varargout = montage2( IS, ...
f02ee6709268533a4880feac7bdd043bfff0c7f9bed086a50fa94b0dce331847
MATLAB
7,486
349
function [pdf,pdd] = mpbdv(v,x) %% Parabolic cylinder function % ========================================================= % Purpose: This program computes the parabolic cylinder % functions Dv(x) and their derivatives using % subroutine PBDV % Input: x --- Argument of ...
fc0335c05f8d5128952cb286fcb9ae5d7e4b03e62e1ad365241118443318e2a7
MATLAB
7,486
142
function parallel_BSC_LSS_FIR(stat_path,sots_path,exp_folder,N,TR,model,q_level,ground_truth) % ======================================================================== % Ruslan Masharipov, October, 2023 % email: ruslan.s.masharipov@gmail.com % ======================================================================== ...
e57bf8ba53e5de3dd65dc98ffec9982d3f3d8e658dbfb04a173cbdd86ad913b4
MATLAB
7,488
162
function GonzalezPereyra_etal_Fig_05 load ([pwd '/Data_GonzalezPereyra_etal_Fig_05.mat']) %#ok<*LOAD> I500Colors=[55 170 200]./255; I200Colors=[255 153 85]./255; Color_300=[100 100 100]./255; Color_500=[255 153 85]./255; [SortedMatrix_Train,maxIndex_FromTrain]=SortThisMatrix_Mean(ZscoresTrain,1000,1290,[]); %#ok<*...
61259e216882ca1dc7364b4b84d212fff696d62b7622ed66f5119e586665196b
MATLAB
7,505
219
function [pos, tri] = headsurface(headmodel, sens, varargin) % HEADSURFACE constructs a triangulated description of the skin or brain % surface from a volume conduction model, from a set of electrodes or % gradiometers, or from a combination of the two. It returns a closed % surface. % % Use as % [pos, tri] = headsu...
bb56d3d79633b29e142be573ba2e1741f72fff4960b943b5d593ba6a5eb5fe59
MATLAB
7,507
150
function [res, rand_diffs] = bootTestDiffSeeds(paths, bootcfg) % This function performs permutation-based significance testing (via % t-test for 2 groups or f-test for >2 groups using the max procedure) % to build a null distribution and control for Type 1 error. % INPUTS---------------------------------------------...
be28c7032eeec56a4a14d878d7c2b783e16e3b0b6c511bdbf8e8a4db59971359
MATLAB
7,515
198
classdef VideoPanel < TempoPanel properties (SetAccess = private) video showFrameNum = true end properties (Access = private, Transient) currentFrameImage currentFrameNum imageHandle frameNumHandle lastDrawNowUpdate en...
21ea328e4b678356100e3b0dee584ebb3e1356c5d8bc48fa82c85d2a597c2a8e
MATLAB
7,517
120
function ActiveDur(MATPATH, FIGPATH, params) %% Parameter setting params.processFcn = @NoveltySU.preprocess.ActiveProcess_3_6Dur; NoveltySU.utils.parseStruct(params); temp = string(strsplit(MATPATH, "\")); protStr = temp(end - 2); DATAPATH = MATPATH; FIGPATH = strcat(FIGPATH, "\"); S...
f86c46ed5bc703c554046b52ad1529649484f4a47f08b86526f7a4d6644196da
MATLAB
7,517
195
function [mri] = align_neuromag2acpc(mri, method, template) % ALIGN_NEUROMAG2ACPC performs an approximate alignment of the anatomical % volume from NEUROMAG towards ACPC coordinates. Only the homogenous transformation % matrix is modified and the coordsys-field is updated. % % Use as % mri = align_neuromag2acpc(mri)...
ff334edeef82e0ca8136f1fb23b34a9a2f919d92c21fde5a24430665ef04cefa
MATLAB
7,517
224
function [Tlocal,Dlocal]=bspline_trans_points_double(O_trans,Spacing,X,check) % If Spacing and points are not an integer, we can not use fast look up tables, % but have to calculate the bspline coefficients for every point if(nargin<4) check = any(mod(Spacing,1)>0)|any(mod(X(:),1)>0); end switch size(X,2) ...
7048435ddb5a677d6b15692145e84e0d55f7e2cae37ae33865ea3f67a2d3d64b
MATLAB
7,522
176
if exist("IdProcedure")==0 IdProcedure = 99 ; end %% INITIALIZE clear ami* rand* adjust* mean_quantization_error legend_entries scDim % clc % Cell arrays per salvare i risultati results_ami = cell(size(som_dims, 1), length(epoch_values)); results_ari = cell(size(som_dims, 1), length(epoch_values)); ...
3c5ff626ac4ca08b666d3c161792acc8cada1b07833673676d35774e25656ab5
MATLAB
7,528
230
function Perm_2group_Ttest_1tp_Figs2(dataOut,IM,params) % This function is the same as Perm_2group_Ttest_1tp_Figs2 except % that it does not plot the block-wise FPR values. % Also, it plots the FPR-p-vals for both % Chi-squared and HG to see dynamic range Pth=0.05/params.B; PthMcN=0.05; [NNidx,Tidx,TNidx]=IM2idx_HS...
5b2c5454e30d7174537296871f3ca0885274cc6f59a7415cf2a75958fe0912db
MATLAB
7,534
214
function [Class, FileDataset] = opencls(Dataset, Original, Verbose) % Class = opencls(Dataset, Original, Verbose) % % Generates a data structure array from ClassFile.cls in Dataset. Each % element of the array (each trial class) contains the fields: Name, Id, % Count, Trials. Trials is a vector of trial ...
b675c5d08ef8d1429638bf732d4249bc3708b3edc951c04e46444157cb3218fd
MATLAB
7,534
205
function names = scnlab_filter_fmri_data(imgs, mvmt, mask, tr, spersess, hp) % Outlier and artifact removal for one subject % Writes new output images for timeseries % % :Usage: % :: % % names = scnlab_filter_fmri_data(imgs, mvmt, mask, tr, spersess, hp) % % :Examples: % :: % % OUT = mean_image(imgs, 'mean_ravol...
e648b9a821f39aa33867efb0d361d2506958955e7a6fee2589df5cad779fc1e9
MATLAB
7,537
189
function PopulationAnalysisThroughTime(config,varargin) %% if strcmp(mfilename,'') || nargin==0 opts=Analyze.Libet.Config_BasicLinearModel; else opts=feval(config,varargin{:}); end if ~isfield(opts,'WindowType') opts.WindowType='windowStarts'; end if strcmp(opts.WindowType,'windowStartsTR'...
cd421c572bf85be37d1b66c032f979e32e3712027a2400952075b7d0692f22af
MATLAB
7,547
201
%%FindEvents function [posevents,negevents]=FindEvents(data,posspikes,negspikes,psn,nsn,psw,nsw,fs,Settings,DoDisplay) % Use the peak information (locations and size) to find events, as defined % in the 'Settings'. Positive events and Negative events are considered % separately and both returned. Optionally, can d...
76315d15f1d874b7651086a0e2d3b49aa18da119961d396cac0ff9b0f70e2ace
MATLAB
7,550
209
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % % Description: % This script performs k-means clustering on maximum muscle moments and compares it with function-based grouping. % I...
900fd3e63987bf36f09a642f853e8d340468533a6f6dfa3a040434a25479ba95
MATLAB
7,554
183
function [parcellation] = ft_datatype_parcellation(parcellation, varargin) % FT_DATATYPE_PARCELLATION describes the FieldTrip MATLAB structure for parcellated % cortex-based data and atlases. A parcellation can either be indexed or probabilistic % (see below). % % A parcellation describes the tissue types for each of ...
9217cc8eceb2804fb67cfe5be714a04f038066404b0cfe670fb0d6349fb0b7dc
MATLAB
7,555
183
function [parcellation] = ft_datatype_parcellation(parcellation, varargin) % FT_DATATYPE_PARCELLATION describes the FieldTrip MATLAB structure for parcellated % cortex-based data and atlases. A parcellation can either be indexed or probabilistic % (see below). % % A parcellation describes the tissue types for each of ...
3a879411395f24118ee450f4bfbd847e677c4630d964574bf2a68b28574bca82
MATLAB
7,559
190
load(fullfile(dipole_folder, strcat(patno,'_',model_name,'_',dipole_name, ... '_output_charge_solution'))); %% XY transverse cross section % Prepare plane data planeABCD = [0 0 1 -Z]; % Equation of the plane of the cross-section (Ax + By + Cz + D = 0)(meters) for neighbor triangle search acceleration ...
9de3a8f7b2c9ae7139a5c9d069635e3367612aac7e046072c8f3c6903eff3a9f
MATLAB
7,559
273
function [ newevents avglongestprobe avgendtotal convergefrac ] = ... wlProc_doEvAnnealAllWave( ... oldevents, samprate, wavedata, ... comparefunc, maxprobes, maxtotal) % function [ newevents avglongestprobe avgendtotal convergefrac ] = ... % wlProc_doEvAnnealAllWave( ... % oldevents, samprate, wavedat...
2e7faf0e600a1457a64f6bcf63fff8ad00073312418830010fe5d582c172babb
MATLAB
7,570
266
%SPTENMAT % %SPTENMAT Methods: % aatx - Implicitly compute A * A' * x for sptenmat. % disp - Command window display of a sptenmat. % display - Command window display of a sptenmat. % double - Convert a sptenmat to a sparse matrix. % end - Last index of indexing expression for sptenmat. % ful...
1dae47272dd76e489ecd468b23dacb9cf5e42a5f825ba129a8d62890626cb20c
MATLAB
7,578
189
% Second-kind integral equation on the unit sphere, Laplace double-layer. % % This is essentially the 3D version of IE_CIRCLE, where now the geometry is the % unit sphere represented using flat triangles. The system is discretized via % collocation with tensor-product Gauss-Legendre integration for the near-field % pan...
7cf5c8474b463b8655f18d8c10689f18303406999325095d72a83598a3841beb
MATLAB
7,578
188
function h_f = plotCuboidSurfaces(nFig,model,simFluorescence) lambdatext = [955 ' [nm]']; % The 955 is the unicode number for the lambda character. Because the editors of MATLAB versions prior to 2020a do not support unicode, we have to make the lambda in this sneaky way. x = model.G.x; y = model.G.y; z = mo...
94da2f1e04d49413a1185c89ef18dba69b2653d9bac5cb3e88d66022ab3e2df6
MATLAB
7,578
267
function [x,iter,resids] = fgmres(A, b, tol, varargin) % Flexible GMRES method % [x,iter] = fgmres(A, b, tol, varargin) % % Tries to solve a linear system Ax=b via the flexible GMRES % % A should be given as a function handle @(x)A(x), which computes the % Matrix-Vector product A*x. % % A and b can be passed as regul...
fa6b39981b1c84a89746206824e08b55c652d2bd4fa89514cc4fa0a2d510e851
MATLAB
7,578
318
function xy = PolyDraw(varargin) %% PolyDraw.m USAGE NOTES AND CREDITS % % Syntax % ----------------------------------------------------- % PolyDraw() % PolyDraw(ax) % PolyDraw(...,2) % PolyDraw(...,...,sec) % xy = PolyDraw(__) % % % Description % --------------------------------------------------...
37687947c542d9775a3d8a3710f7039c41dee8bbc5fbe2fe524ac0e03477a358
MATLAB
7,579
201
%PRINT_PDF Prints cropped figures to pdf with fonts embedded % % Examples: % print_pdf filename % print_pdf(filename, fig_handle) % % This function saves a figure as a pdf nicely, without the need to specify % multiple options. It improves on MATLAB's print command (using default % options) in several ways: % - ...
69548ce6094a898049f87af91deaf358e971b1daf480fd725a0701250c0f7ba9
MATLAB
7,581
202
classdef TopologicalSpace < handle_light % Collection of sets on which maps such as chart and embedding are % defined. % Roughly corresponds to the concept of a topological space but really % just a bookkeeping device to keep track of domains in the surface on % which maps can be defined. ...
4c7fd57ae267f2f5723a5f2bba434f16348ce362dc5a7e334c8cc0fad991e446
MATLAB
7,586
178
function [varargout] = read_plexon_nex(filename, varargin) % READ_PLEXON_NEX reads header or data from a Plexon *.nex file, which % is a file containing action-potential (spike) timestamps and waveforms % (spike channels), event timestamps (event channels), and continuous % variable data (continuous A/D channels). % %...
5074f8c84220ee6c63ab6a2472a6bcd4036d4ad04699b53de640e71bfb64b081
MATLAB
7,600
157
function results = predict_featsets(datadir, kerneldir, resultsdir, HMM_name, varN, iterN, Fn, Kn, FSn) % results = predict_featsets(datadir, kerneldir, resultsdir, HMM_name, varN, iterN, Fn, Kn, FSn) % % runs kernel ridge regression to predict behavioural variables (here age % and intelligence in HCP dataset) using di...
c2449fb990a20f346e11702edaf334904f029f9844520ad0577e30bdf5b3d7d5
MATLAB
7,601
210
function [freq] = ft_freqbaseline(cfg, freq) % FT_FREQBASELINE performs baseline normalization for time-frequency data % % Use as % [freq] = ft_freqbaseline(cfg, freq) % where the freq data comes from FT_FREQANALYSIS and the configuration % should contain % cfg.baseline = [begin end] (default = 'no'), alterna...
7aab0cb3f561fb7c14589822000249e0c86247d6669ba7ee2c4c9b6de5ba25c3
MATLAB
7,603
206
%PRINT2EPS Prints figures to eps with improved line styles % % Examples: % print2eps filename % print2eps(filename, fig_handle) % print2eps(filename, fig_handle, options) % % This function saves a figure as an eps file, with two improvements over % MATLAB's print command. First, it improves the line style, makin...
daf47858eccd1cff06fcae24597973e504fbaa6e6cb16973116f78441f624170
MATLAB
7,610
269
function datasetId = h5datacreate(h5file,varname,varargin) %H5datacreate Create HDF5 dataset. % % H5DATACREATE(HFILE,VARNAME,parameter,value,...) creates a dataset % named VARNAME. HFILE may be either a path to the HDF5 file or a file % ID to an already opened file. % % If VARNAME is a full pathname, all ...
a8614ec371d3d977579946b6b2ea938dc0a7912e3eb8a7184219bdac7a9bd6ac
MATLAB
7,619
187
%% This script performs repeated-decodings of a given simulation with varied decode parameters % varyDecodeParam.m % % run_grid_decode.m performs decoding across a parameter grid. % It calls run_param_decode to decode each parameter, and this calls % run_net_decode.m to decode each network. % % Outline: % - Loa...
9d40bce640de2eea68828290b2a7b97c8c7ec9a2cde061c665eda31f1377bf60
MATLAB
7,623
168
function homo_with_weight = CBIG_MSHBM_parameters_validation(project_dir,mesh,num_sess,num_clusters,subid,w,c) % homo_with_weight = CBIG_MSHBM_parameters_validation(project_dir,mesh,num_sess,num_clusters,subid,w,c) % % This script will estimate the individual-level parcellation for the % validation subjects with num_c...
2eeb7fede490a1ee64764598c778fc54a84bf39ad3b751f7ccf2bfb7624fba32
MATLAB
7,624
129
%% Description % Here, we demonstrate calculation and plotting of the far field angular % distribution of the "escaped" photons, both for excitation light and for % fluorescence light. It is enabled by specifying the optional % "farFieldRes" parameter, which serves also to specify the resolution you % want of the far f...
7557180342feac161b5a7b2ec36d14e14ba42e34ef2083b5c9e7556af623740c
MATLAB
7,625
211
% Author: Birgit Nierula % nierula@cbs.mpg.de function [amp, lat, snr] = get_mergedData(condition, srmr_nr, subjects, has_allsubj) %% set variables loadpath_ga = getenv('GADIR'); % get condition info [cond_info] = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; nerve = cond_info.nerve; str_st...
d3280a87fbba409a711482754cc37e8d6480e9dd23f148ea60da6a4c5ea0cb78
MATLAB
7,629
200
function [obj] = ft_convert_units(obj, target, varargin) % FT_CONVERT_UNITS changes the geometrical dimension to the specified SI unit. % The units of the input object is determined from the structure field % object.unit, or is estimated based on the spatial extend of the structure, % e.g. a volume conduction model of...
138be4761ada742cd5d31b9d271b918320186330bdedfbbb2294ddaa7a12b252
MATLAB
7,630
243
classdef TrxVisualizer < handle % shows a trx/centroid marker, text label, trajectory traces properties parent_ % scalar LabelerController lObj % scalar Labeler, derived from parent_.labeler_ hTraj; % nTrx x 1 vector of line handles hTrx; % nTrx x 1 vecto...
6e6bf35ca1aae5a13b95cbbff26b2b5e4ebbb3f1cdaeec1093ba55ef978d2d76
MATLAB
7,630
281
%%cell count clear all close all for i = 1:2 for f = 1:2 cd Example_images/ filename1 = ['220311_5050_1_cs' num2str(f) '_20X_' num2str(i) '_DAPI.tif']; filename = extractBefore(filename1,'DAPI'); dapi = imread(filename1); [px, py] = size(dapi); % figure % su...
f9a5f915932dc827e1698d48f61ff3fa951c5d832580aa08bea05cd901246e18
MATLAB
7,632
283
function hh = errorbar_h(varargin) %ERRORBAR Error bar plot. % ERRORBAR(X,Y,L,U) plots the graph of vector X vs. vector Y with % error bars specified by the vectors L and U. L and U contain the % lower and upper error ranges for each point in Y. Each error bar % is L(i) + U(i) long and is drawn a distance of ...
3e9067e50c0abb4153acf1d5d12b310336b5ebdbe77aee7c52349eb2fc0b82be
MATLAB
7,633
205
function [dipout] = ft_eloreta(dip, grad, headmodel, dat, Cf, varargin) % % Use as % [dipout] = ft_eloreta(dipin, grad, headmodel, dat, cov, varargin) % where % dipin is the input dipole model % grad is the gradiometer definition % headmodel is the volume conductor definition % dat is t...
e6bcd007dc46477f29ea7b285d988300c70e2f240eed92755cb5e0c12a5b9f18
MATLAB
7,633
198
function varargout = DPABISurf_FieldMap(varargin) % DPABISURF_FIELDMAP MATLAB code for DPABISurf_FieldMap.fig % DPABISURF_FIELDMAP, by itself, creates a new DPABISURF_FIELDMAP or raises the existing % singleton*. % % H = DPABISURF_FIELDMAP returns the handle to a new DPABISURF_FIELDMAP or the handle to %...
2cda83a58d918dd94ccbf29453a92d0e305d5618efd00e4f026bba0b7dd6fb50
MATLAB
7,635
184
function [Objects] = f_imageAnalysis(Label, chHoechst, chMAP2, chFOXA2, chTH, PreviewPath, MetaTable) %vol(chHoechst, 0, 1000) %vol(chMAP2, 0, 2000) %vol(chTH, 0, 2000) %vol(chFOXA2, 0, 1000) %% Organoid segmentation chOrganoid = imlincomb(0.25, chHoechst, 0.25, chMAP2, 0.25, chFOXA2,...
e94fd31b6a0c2f8b01a84f75668a55f817f8995e8fc247d68bd46fdf7d8bfe10
MATLAB
7,636
192
% rectify_stereo_pair.m % % Script file that rectifies a set of stereo images after stereo calibration % This script loads the stereo calibration file Calib_Results_stereo generated by calib_stereo.m % Therefore, type help calib_stereo for more information. if ~exist('fc_right')|~exist('cc_right')|~exist('kc_right')|...
6ef834a4e6a7d642a8e3f006c9f3bc891c3c3ea83a119e757e537f861d1a696e
MATLAB
7,639
205
function [dipout] = ft_eloreta(dip, grad, headmodel, dat, Cf, varargin) % % Use as % [dipout] = ft_eloreta(dipin, grad, headmodel, dat, cov, varargin) % where % dipin is the input dipole model % grad is the gradiometer definition % headmodel is the volume conductor definition % dat is t...
8f23730e9c18d6511d1e0c6e5d819baafb3a309cc4bbed4b1f08f414077a7d8b
MATLAB
7,644
231
% onsetsim corepath = pwd; addpath([corepath,'/functions']) ath = 0.05; % arbitrary threshold value for ttest pth = 1 - ath; % permutation threshold Nperm = 2000; %% Make template % true onset = 160 ms, F=81, max at F=126 true_onset = 160; Xf = 0:2:500; % 500 Hz Nf = length(Xf); temp1 = zeros(1,Nf); erp = normpdf(li...
040b11dac17c959fc7a7a74575824bc6976ada0635449a0ea8d05bb0bfab3729
MATLAB
7,645
312
%load data: contact lead author %% MEAN DFOF i=find(nRuns(:,1)>1); allAverageDfofsUse=allAverageDfofs(i); ddAO = cat(2, allAverageDfofsUse{:}); % ddAO=ddAO(iUse); ddAO = ddAO(aoCellIdx); ddVS = cat(2, allAverageDfofsUse{:}); % ddVS=ddVS(iUse); ddVS = ddVS(vsCellIdx); figure; hold on a=ddAO'; b=ddVS...
0ab5e44c70613dc20809418f4fe75d5f56e135bb4d742b7c88de0da44bdc4c04
MATLAB
7,649
190
function varargout = w_SurfClusterSize(varargin) % W_SURFCLUSTERSIZE MATLAB code for w_SurfClusterSize.fig % W_SURFCLUSTERSIZE, by itself, creates a new W_SURFCLUSTERSIZE or raises the existing % singleton*. % % H = W_SURFCLUSTERSIZE returns the handle to a new W_SURFCLUSTERSIZE or the handle to % t...
07d28330b209b0d70fa8b2b043ce57e085eeaf19292edfed0722f9537fdfd294
MATLAB
7,651
185
%% Description % This example shows how to import a shape from an STL file (sample.stl) % and optionally apply scaling (unit conversion), rotation and mirroring on % the mesh before using a function to voxelise the mesh. % % Importing is done inside the geometry function at the end of the model % file (this file). The ...
bdcbc985b4c8a7455ef45a9ac0077fe1e2a6f27ffc333182d353d28011c2a6d7
MATLAB
7,661
169
function [VMHCBrain, Header] = y_VMHC(AllVolume, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header) % [VMHCBrain, Header] = y_VMHC(AllVolume, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header) % Calculate VMHC % Ref:...
22fded8e52328deebb075fac860bd23c87758e61ca37636553033fe66a7c6969
MATLAB
7,664
238
function [newpupil] = blink_regressout(pupildata, fsample, blinksmp, saccsmp, plotme, addBackSlowDrift) % method by Knapen, de Gee et al. (2016) % http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0155574 % estimate canonical responses to blinks and saccades, then take those out % of the pupil timecours...
67d6a95d369547bd1414eb0378931e26c582387a4627d5b8bdb6de4b69294de9
MATLAB
7,671
233
function hfig = tightfig(hfig) % tightfig: Alters a figure so that it has the minimum size necessary to % enclose all axes in the figure without excess space around them. % % Note that tightfig will expand the figure to completely encompass all % axes if necessary. If any 3D axes are present which have been zoome...
e7020289cd3c53cc7d077b84bcce5bf74070019000540b44f3389e9eb2d6bbe6
MATLAB
7,676
217
function [dat] = ft_fetch_data(data, varargin) % FT_FETCH_DATA mimics the behaviour of FT_READ_DATA, but for a FieldTrip % raw data structure instead of a file on disk. % % Use as % [dat] = ft_fetch_data(data, ...) % % See also FT_READ_DATA, FT_FETCH_HEADER, FT_FETCH_EVENT % Copyright (C) 2009-2013, Jan-Mathijs Sch...
e94a7dd6fab7ac57fd524de8c5b39affda6d5b9e856628b403641123f33fb2bf
MATLAB
7,676
231
% Rob Campbell (2023). raacampbell/shadedErrorBar % (https://github.com/raacampbell/shadedErrorBar), GitHub. Retrieved % July 18, 2023. function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a ...
27445b9f938d4de4e1c73d8dc70f3ba40695c6abb89b5c4c68fa09246e3b348b
MATLAB
7,680
187
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% n0_sample_dipole_positions.m -- Uniform sample (without repetition) %%% %%% of random dipoles, perpendicular to the grey matter shell %%% %%% of the patient. %%% %%%%%%%%%%%%%%...
ac9b8a702e5f48d7c0ee254046577d72c2aab2bb55bde6c8b4e9aafcbe88372e
MATLAB
7,681
269
function CBIG_DrawSurfaceMapsWithBoundaryInteract(lh_data, rh_data, ... lh_labels, rh_labels, mesh_name, surf_type, min_thresh, max_thresh, colors) % CBIG_DrawSurfaceMapsWithBoundaryInteract(lh_data, rh_data, ... % lh_labels, rh_labels, mesh_name, surf_type, min_thresh, max_thresh, colors) % % This function is...
f7731c5e3ba604c0bd470eaaad457e596b8352fa4b05c5376c9f62eaf30f4feb
MATLAB
7,681
214
function [dataout] = ft_heartrate(cfg, datain) % FT_HEARTRATE estimates the heart rate from a continuous PPG or ECG channel. It % returns a new data structure with a continuous representation of the heartrate in % beats per minute. % % Use as % dataout = ft_heartrate(cfg, data) % where the input data is a structure ...
7136e2c0af5c31cc61dd726676615760c007c1a3b9f4859af0e3941dcbc50be0
MATLAB
7,688
188
function [PBEstruct] = detect_PBE(spikes, modelParam, varargin) % detect_PBE.m % % Detects population burst events. Assumes 'spikes' only includes cells % that you want to include in burst detection (e.g. E-cells only). % % Inputs: % - opS: logical spike matrix, opS(ithCell,ithTimeBin,ithTraj,ithTrial) % - modelPar...
8263bf981f69b0e067bb18be523a487ae624c167feed02e3c9d4ddd6ffbc5f5c
MATLAB
7,690
238
function ft_write_headshape(filename, bnd, varargin) % FT_WRITE_HEADSHAPE writes a head surface, cortical sheet or % geometrical descrition of the volume conduction model or source % model to a file for further processing in external software. % % Use as % ft_write_headshape(filename, bnd, ...) % or % ft_write_hea...
6daaddf1ff922670b7c01d8a3935b8285fafc1f27a3bf9dfb4b358bbbf0fcc07
MATLAB
7,694
243
function [X_train, Y_train, X_test, Y_test] = makeCrabs() % Crabs data set from http://www.stats.ox.ac.uk/pub/PRNN/ % Xtrain: 80 * 5 % Y_train in {1,2} for male, female % Xtest: 120*5 % Ytest in {1,2} % % First column: true label % 0 = Blue male % 1 = Blue female % 2 = Orange Male % 3 = Orange Female % c...
78c796fbcb5129553307d3684470954584f5f1ef95f218ef1b206aeae14890be
MATLAB
7,694
214
function [dataout] = ft_heartrate(cfg, datain) % FT_HEARTRATE estimates the heart rate from a continuous PPG or ECG channel. It % returns a new data structure with a continuous representation of the heartrate in % beats per minute. % % Use as % dataout = ft_heartrate(cfg, data) % where the input data is a structure ...
d3f4f76c2d207b4f204c48cb546c6e00f63421de4cf0f38a96a0ac5b95db3884
MATLAB
7,695
215
% Author: Birgit Nierula % nierula@cbs.mpg.de %% SRMR2_03_esg_analysis clear; clc delete(gcp('nocreate')) % clear parallel pool %% variables that need to be changed % step step_number = 1; % sampling rate sampling_rate = 1000; % subjects subjects = 1:24; %% define variables and paths % experiment srmr_nr = 2; % c...
9fe83dfcb051c95a1fbf207956f8fba47ea420ee6b2ea04ebd773da49bc6fc4a
MATLAB
7,696
209
function varargout = ReorientThreQC(varargin) % REORIENTTHREQC MATLAB code for ReorientThreQC.fig % REORIENTTHREQC, by itself, creates a new REORIENTTHREQC or raises the existing % singleton*. % % H = REORIENTTHREQC returns the handle to a new REORIENTTHREQC or the handle to % the existing singleton...
9f8271fa8e9eca367215159ded18525856dac398d0a9989e35fb95e3edc6dd37
MATLAB
7,702
172
function [Obj,modified] = SOFAupgradeConventions(Obj) %SOFAcompatibility % [Obj,modified] = SOFAupgradeConventions(Obj) upgrades the Obj to the next higher % version if required. MODIFIED is 1 when an upgrade was required. % In order to obtain the most recent version, SOFAupgradeConventions % should be proces...
cda07c20a827fd3b556802b946892b885448665cb885c5c70999b04f5b98b86f
MATLAB
7,713
280
outDir = '/nrs/branson/mayank/jay/out/'; trkDir = '/nrs/branson/mayank/jay/tracks/'; dd = dir(fullfile(outDir,'*.h5')); %% params = singleViewTrackingDefaultParams; parfor ndx = 1:numel(dd) curIn = fullfile(outDir,dd(ndx).name); curOut = fullfile(trkDir,dd(ndx).name); if ~exist(curOut,'file') trackSingleVie...
4b5f96a75b68dace9037d26920c16043a89b3a504fa0b8abad60209d4a25b53e
MATLAB
7,714
249
function [handles] = VBA_spm_uitab(hparent,labels,callbacks,... tag,active,height,tab_height) % Create tabs in the SPM Graphics window % FORMAT [handles] = spm_uitab(hfig,labels,callbacks,... % tag,active,height,tab_height) % This function creates tabs in the SPM graphics window. % These tabs may be associated w...
fccb02fb3fa12ef7a0fc1013217edb84b65d9d20d7020aff462cf16d4a36678b
MATLAB
7,716
222
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File : GetOMEData.m % Version : 1.3 % Author : czsrh % Date : 13.09.2019 % Insitution : Carl Zeiss Microscopy GmbH % % Simple script to get "some" not, but not all metainformation using % the MATLAB wrapper for the BioFormats...
a618d2032fbf89fd8a9b740c454a28ca5e06634ad742857ed277e8d7f143f281
MATLAB
7,728
200
%% ============== Statistical Analaysis ===================== %% %% load data and directories clear fundir = pwd;%[maindir 'TMS_code/']; datadir = pwd;%[maindir 'TMS_code/']; savedir = pwd;%[maindir]; addpath(fundir); cd(fundir); defaultPlotParameters sub = load_TMS_v1([datadir '/TMSanalysis_1...
3f72ee5d97d9cbec0335b34416dcd2b0d76524877ff24e6ccb65ac229e6f836f
MATLAB
7,740
139
%% Description % This example shows how to execute MC simulations in a for loop, in this % case simulating a pencil beam incident on a slab of "standard tissue" % with variable (parametrically sweeped) thickness. The slab thickness is % passed in as a part of the GeomFuncParams field and used in the geometry % function...
cef201de59687f7d64ae98094eaa61f6fb8dd058e37e2c9cf6ef0e6860b3cc14
MATLAB
7,742
283
% latencia.m % % v.0.5.2 fix 26.11.2009 % % Genera LAN.time % para luego poder epoquira LAN.data continuo % res = % code of event mark of epoch % parametres = [1 2 ; 4 8] % eventos % % si es 'no' solo bustca los res. % names = % nombre de tipos de vento [ {control} {t...
8316742060bab4ef9e140e70896e06ed531dd63a1024f8388b886ddf5ff4e3be
MATLAB
7,743
178
function [] = GroupDataToRegions (parameters) mice_all = parameters.mice_all; periods_all = parameters.periods_all; dir_groups = parameters.dir_in_groups; groups_file_name = parameters.file_name_groups; groups_variable_name = parameters.groups_variable_name; dir_input_base = parameters.d...
e0d0e75daa2be9002a9c8faad1b02ef8ee75d14a28de4d5612432f28335a4811
MATLAB
7,746
175
function [place_fields,t,replay_time,replay_spikes,ground_truth_replay]=generate_linear_replay_events(number_of_place_cells,no_of_events) % This code is used to generate place fields and then simulate linear replay trajectory and generate place % cell spiking (Possion process) % % Masahiro Takigawa 2023 % First cr...
b4eecdaf9b847fe145b8c9ab647d81663963b93e1b402a1fb7473a66bbfb54b4
MATLAB
7,749
205
%% for passive touch, finds the onset of the first peak, late wave, and also the peak times clear close all Fs = 2500; %paths to the relevant data sets for Figure 2 dataPaths{1} = 'D:\InVivo\Baclofen\2022-04-19_Baclofen\3-baseline_220419_104537'; dataPaths{2} = 'D:\InVivo\Baclofen\2022-04-21_Baclofen-Attem...
692c5f1a2b12fbd10e010f98c07d9c025bf2c055aa877ecbbf6c63e026b2718a
MATLAB
7,751
270
function cluster_visual_(GLAN,clus_ind,stat_ind, data_ind,para) %GLAN = MODEL_l % if nargin <5 para=[0 .1 4 10 1 50]; end tt1=para(1); tt2=para(2); ff1=para(3); ff2=para(4); th1=para(5); th2=para(6); if nargin<4 stat_ind=1; end if nargin<3 | isempty(data_ind) d...
d391e5fc7fca2f619d4f26753aaa20cfda1c34f37ca2e0c20c002496d6993c3b
MATLAB
7,752
336
clear all close all clc % Use this script to generate figures similar to those in Figure 3A of: %Luna, R., Li, J., Bauer, R., & van Leeuwen, C. (2023). Retinal waves in adaptive %rewiring networks orchestrate convergence and divergence in the visual system. %Network Neuroscience cd '..\scripts\Output' ...
3b9c6ce2db3e6b4f060808029b46113096cd78a5755f1387098540a41fde447c
MATLAB
7,763
227
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % % Inputs (required)...
38d021a755d52f163d16ca11160e7569bd300f03ab34f4c0a3a9f46b895c74a6
MATLAB
7,764
244
classdef AxisHUD < handle % Axis heads-up display % % Contains: % * Series of text labels like Tgt: 3 % * handedness indicator % TODO: Refactor for extensibility, just have structs/dicts instead of % hardcoding state/meths for tgt vs lblpoint vs susp etc. properties (Constant) txtXoff = 10 txtHgt = 17 ...
31af221dfe40ef682d44f37ae3b09077bf4e7e370821d1c8923d166c1c0243bc
MATLAB
7,766
173
function [ALFFBrain_AllWindow, fALFFBrain_AllWindow, GHeader] = y_alff_falff_Surf_Window(WindowSize, WindowStep, WindowType,InFile,ASamplePeriod, HighCutoff, LowCutoff, AMaskFilename, AResultFilename, CUTNUMBER) % Use dynamic ALFF method to compute the brain and return a ALFF brain map which reflects the "energy" of t...
203b0392901c49ba31939155ce1a68c00cd54a2abc61dc8af1e6b95bc7bcf934
MATLAB
7,768
229
function CBIG_Plot17NetworksRearrCorrMat_WhiteGrid(lh2lhcorrmat, ... lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix) % CBIG_Plot17NetworksRearrCorrMat_WhiteGrid(lh2lhcorrmat, ... % lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix) % Example : CBIG_Plot17NetworksRearrCorrMat_WhiteGrid(lhlh, lhrh, rh...
5e42f3d73373e678e88cfe71604a36eea8f7602375a19934d268e3ad16192cef
MATLAB
7,768
267
function [C,time,g,s,k, phi, sta, stb] = minTimeGradientRV(C,g0, gfin, gmax, smax,T, ds, show) % [C,time,g,s,k] = minTimeGradient(C, g0, gfin, gmax, smax,T,ds, show) % % This function computes the rotationally variant solution to the time % optimal gradient design. % % C - The Curve in k-space given in a...
dafb72d1e9e94b6380191d6ae67c4f6ce39f4e601f3be7935aa94c0f17c385ef
MATLAB
7,772
260
classdef LabelCoreSeqModel < LabelCoreModel % Sequential labeling model % % Label mode 1 (Sequential) % % There are two labeling states: 'label' and 'accepted'. % % During the labeling state, points are being clicked in order. This % includes the state where there are zero points clicked (fresh image). % % Once all poi...
882e3c2d3d2494422a0c52991c9000ae201bd5aee144b5253cb73309f252a6d5
MATLAB
7,778
235
function freezeColors(varargin) % freezeColors Lock colors of plot, enabling multiple colormaps per figure. (v2.3) % % Problem: There is only one colormap per figure. This function provides % an easy solution when plots using different colomaps are desired % in the same figure. % % freezeColors freezes the co...
92854b3360adc358e0ad4c212c9e87f2e3f3a5aba2614fad8954723d29cbc82f
MATLAB
7,778
264
function [model, loglikHist] = mixGaussBayesFit(X, K, varargin) % Variational Bayes for fitting mixture of K gaussians % data(i,:) is i'th case % See Bishop sec 10.2 for details % %PMTKauthor Emtiyaz Khan, Cody Severinski, Kevin Murphy % This file is from pmtk3.googlecode.com [maxIter, thresh, plotFn, verbose, alpha0...