sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
7b3686dadb1deaaa75785d809356de25482c35dadd2a3658c940feb65c755bb8
MATLAB
5,560
164
function [distance,units] = IsolationDistance(features,varargin) %IsolationDistance - Determine the isolation quality for one or more clusters. % % Compute isolation distance, as defined by K. Harris (see Schmitzer-Torbert % et al. 2005). % % USAGE % % [d,units] = IsolationDistance(features,<options>) % % featu...
71dfadff47f12bb05d56b8cda24ba9f0f2228aed1a09071afb3e264aaa198d6e
MATLAB
5,561
132
function net = cnn_cifar_init_nin(varargin) opts.networkType = 'simplenn' ; opts = vl_argparse(opts, varargin) ; % CIFAR-10 model from % M. Lin, Q. Chen, and S. Yan. Network in network. CoRR, % abs/1312.4400, 2013. % % It reproduces the NIN + Dropout result of Table 1 (<= 10.41% top1 error). net.layers = {} ; lr = [...
ce986515957b00572d843daef6db22c1d2785b5f4686137bb0897a6e4d9127f0
MATLAB
5,563
84
function outstr = GE_dumpExamHeader(exam) % % outstr = GE_dumpExamHeader(exam) % % Writes the exam header to the string outstr % % Souheil J. Inati % Dartmouth College % May 2000 % souheil.inati@dartmouth.edu % outstr = sprintf('ex_suid: %s\n' , char(exam.ex_suid)); outstr = strcat(outstr, sprintf('ex_uniq: %d\n' ...
0d238b9c90975240ec2cf0333c979ac461b74c1aa8aacb082cbcc98737d3602a
MATLAB
5,564
130
% controls the user interface with keyboard and mouse callback for % analyzing a FOV as quickly as possible; check the % switchImage()-subfunction for further details and a brief manual % % open window of FOV which allows to zoom and pan and select neurons % manually ('f' for freehand) or automatically ('x' for % cross...
35f502f7448c2d86466dafc6527a78866722e5bb9114b06bfd8d13af8a12701f
MATLAB
5,568
155
% analysis_FeaturePredictionAccuracy Calculate feature prediction accuracy % % Author: Tomoyasu Horikawa <horikawa-t@atr.jp>, Shuntaro C. Aoki <aoki@atr.jp> % clear all; %% Initial settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Data settings % subjectList : List of subject IDs [cell array] % ...
734f1a5d899a256d079b595984ec2eecd1743a9ae3819cc5566e7c3e29ed4e94
MATLAB
5,570
171
function brain3D_projections(params, vals, plotInfo) % plots iEEG channel activations on 3D transparent brain model % prints axial, sagittal and coronal views % (c) Jiri, Apr17 %% color maps clrmap.brain = gray(128); % colormap for brain (T1, T2, CT, ...) if isfield(params.plot_brainTopo, 'c...
47aa930e5458df47f3ea8a82cc4555666f6ae2a8fb3945fce31fd5ecc4a5bdc1
MATLAB
5,571
139
function [formatted_method_string,options]=genMethod(method_name,varargin) % EXAMPLE USE WITH ARGUMENTS % [formatted_method_string,options]=genMethod(method_name) % [formatted_method_string,options]=genMethod(method_name,options) % % HELP % Generates class method template to be pasted into existing class file. % Create...
9c0e26f33a0d5ee90826545acc6062f01cb80ea34e0de7beab6ccc57c008c752
MATLAB
5,571
147
function [IDs,notIDs] = TS_GetIDs(theMatchString,whatData,tsOrOps,nameOrKeywords) % TS_GetIDs Retrieve IDs of time series (or operations) in an hctsa dataset % using that matches a string in either the Name or Keyword % fields. % %---INPUTS: % theMatchString, the string to match % whatData...
ced99019c3d98339fbc5f390b1f5b4d93fdaf0da22a73fa16803f7919a4d9ec2
MATLAB
5,573
132
%{ rf.Sync (imported) # mapping of h5,ca imaging, and vis stim clocks -> rf.Scan --- -> psy.Session first_trial : int # first trial in recording last_trial : int # last trial in recording frame_times : longblob ...
3efb2097186433b1bf4d4bddaee9835e82c6c9c9ff57f2e98898e6d1271409a3
MATLAB
5,579
110
function out = EN_wentropy(y, waveletName, level) % EN_wentropy Wavelet entropy of a time series. % % Decomposes y via the maximal-overlap discrete wavelet transform (MODWT) % into a set of scales, computes each scale's share of the signal's total % energy, p_j = E_j / sum(E), and returns the Shannon entropy of this ...
74fc53c79104a3bdacd9301cccc61b2a2265395c7de507b7aa947936daefc164
MATLAB
5,580
199
% [chi2,df,p,sig,warn,isnonparametric] = chi2test_massive(seedcounts, counts,[obs. weights],[nonpar flag]) % % Weighted or unweighted Chi-square test % from observations % Optional nonparametric estimation for questionable results % SEE CHI2TEST.M % THE PURPOSE OF THIS FUNCTION IS TO IMPLEMENT A CHI2 TEST EFFICIENTLY W...
a183bab0f79da13ec03bcac7653ccdc9ede3e33b29a5ed5dc937080220dba874
MATLAB
5,580
90
% clean_rawdata(): a wrapper for EEGLAB to call clean_artifacts function % % Usage: % >> EEG = clean_rawdata(EEG, arg_flatline, arg_highpass, arg_channel, arg_noisy, arg_burst, arg_window) % % ------------------ below is from clean_artifacts ----------------------- % % This function removes flatline channels, low-fr...
d4a2ab9be8d772c5be9d41068117c9750089ff8df0fa7704e4c45ecce6d6f49f
MATLAB
5,580
146
%% SpatialTuningCurve % Draw firing map of units %% Dataset Paths datasetBasePath = 'D:\Data\Lobster\FineDistanceDataset\'; resultBasePath = 'D:\Data\Lobster\FineDistanceResult_syncFixed_May'; filelist = dir(datasetBasePath); sessionPaths = regexp({filelist.name},'^#\S*','match'); sessionPaths = sessionPaths(~cellfun...
33fcb3215c1e23c146344fe679c304d1081aac67d4f17eae5947f64d49a772bf
MATLAB
5,583
145
% STD_CHECKDATASESSION - Check/fill session field in STUDY. Based in the % name and IC decomposition of datases, the function determine which % ones are coming from the same sessions. % It will assign the same index number to the sets from the same subject coming % from the same session. % % Usage: % >> clustinfo =...
a1f85d65831dabf6f6a8f176436b4821b92e1fcca034c8c30d23840f0371dfea
MATLAB
5,583
177
function avi_filename = show_demixed_video(obj,save_avi, kt, frame_range, amp_ac, range_ac, range_Y, multi_factor, use_craw) %% save the final results of source extraction. %% inputs: % kt: scalar, the number of frames to be skipped %% author: Pengcheng Zhou, Columbia University 2017 % zhoupc1988@gmail.com if ~exis...
74d5da0372977e4cc997e55a0ca98216aae077db8502fc4125703ebc1dd18b90
MATLAB
5,593
141
function [outFlag,theName] = BF_CheckToolbox(theToolbox,infoMode,doInstallCheck) % BF_CheckToolbox Check for a Matlab Toolbox license % % Checks for the given Matlab Toolbox license and produces an appropriate error % message if there's a problem. % %---INPUTS: % % theToolbox, the string identifying the toolbox (in f...
9543b02940a65b7446d0ec5a3a21cc0c6a54f45c0e5b5e43736f882d53ac2527
MATLAB
5,595
183
%January 2025 SW: Script that reads out a portion of the eye and reads the average %brightness over time from a tiffstack (frames) %% %NOTE: BLUE and ORANGE do not cause a change, so focus only on RED %darkness %blue stack: 1-2274 %orange: 1-2434 %red : 1-4134 %ambient light_animal 676 %blue stack:1-16734 %orange: 1-...
eeb8b3e2765f5c1654f89b1f49830d11b20957d69abd70ec3404c5666f244ee1
MATLAB
5,597
143
function [dist,bin_centers,stats] = CircularDistribution(angles,varargin) %CircularDistribution - Compute circular distribution and statistics. % % USAGE % % [dist,bin_centers,stats] = CircularDistribution(angles,<options>) % % angles angles in radians, which will be shifted in [0,2π) % <options> ...
62bc75f40172bc5d82b3821f5d1e15a9ec7db990bdd03eca15fae85fa87cfe69
MATLAB
5,599
138
function [C3] = BIASED(C3,myelin,funcs,PB) C3_x = C3.x; C3_y = C3.y; C3_bias_func = funcs.C3_bias; % define step size delta = 1; % Create 2 column matrix where column 1 is x pos, column 2 is y pos C3_xy = [C3_x;C3_y]'; % Create a mask of x,y pos where myelin is not dead alive_my_x = myelin.xarray(m...
ab917a8cc43c53f41791e0525eea0d36f3c01e61894fea969318b6c2480dba89
MATLAB
5,600
160
function [convRVTOut, rvtOut, verbose] = tapas_physio_create_rvt_regressors(... ons_secs, sqpar, model_rvt, verbose) % computes respiratory response function regressor and respiratory volume per time % % [convRVTOut, rvtOut, verbose] = tapas_physio_create_rvt_regressors(... % on...
f93cd81d74dec8938e3bb45efa7e5db39c67a58569b2f059c416253940de20f2
MATLAB
5,600
161
function EC_avg = plotEC_targetGroups_imagesc(params, M, EC_info, selCh_groups, subjTag) % plots effective connectivity (EC) of selected channel group (= params.grup_source) to all other groups % plots = imagesc (a-la spectra) for each class: src->trg & trg->src % input: M = 5D: ch_src, ch_trg,freq, time, clz % channel...
fdcf5df3fec36f90272f0e0523bb574051db61062d3e4efc2b7a705cead299f5
MATLAB
5,603
155
function allExpData = compileAllExpData(ExpName, experimentMatFileFolder, Params, metricLevel) %COMPILENETWORKLEVELDATA Combines data from multiple NetMet structures % INPUT % ------------ % ExpName : cell % cell where each entry is the name (without extension) of a file to % compile the data for % experimentM...
098b5529c9ecaaf006eced8392c29f0ad59778e2d85f89d26f67b5ed2da4141e
MATLAB
5,604
204
%{ TO BE UPDATED / TO BE UPDATED / TO BE UPDATED / TO BE UPDATED %%%%%%% Preprocessing of BFM data %%%%%%%% *** INPUT *** Point to the master folder that contains the .dcimg data to process (green and red channels) The convention imposes: 'basename + _G or _R + .dcimg' *** OUTPUT *** Unmixed voltage ...
dd8805645f26396b6e21fd4014fff775009ed64a58fdb62cd09d04592f0b6550
MATLAB
5,604
157
function [L,varargout] = defineSearchlight_volume(ROIMask,Mask,varargin) % function L = rsa.defineSearchlight(Mask,Opt) % Defines a volumetric searchlight using all voxels that are > 0 in both % ROIMask and the Mask as centres for the searchlights and as potential voxels % to be included in the searchlight. % The Ma...
c1d8163774ba865f347d20a5d1058ffbeeeb10d2f7ecfa4fb9cebca0128e4ada
MATLAB
5,606
133
function F = fit_nlinOspreyMultiplex(x, dataToFitInput, basisSet, spl_pos, fitRangePPM) % This function receives the current set of non-linear parameters during % every iteration of the non-linear least-squares optimization. The % parameters are applied to the basis set. % % Subsequently, a fast non-negative l...
60cd82955cb0d7b453d7d116d273e10c3b35544eda589886d6016c3a4252db6f
MATLAB
5,607
171
function fear_coactTrigWaveletHighThreshold(basename,varargin) % basename='~/data/Fear/triple/karmeliet190901/karmeliet190901'; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName); load([basicMetaData.AnalysesName '-nremWaveletPow.mat']) param...
16880e61fc9ddf51f7acfdf6205bbd2464371eeeaa30b90696846dc8eab91bbb
MATLAB
5,611
144
function M = euclideansubspacefactory(E, proj, dim) % Returns a manifold struct to optimize over a subspace of a linear manifold % % The factory produces a manifold description M for a linear subspace S of % a linear space E. % % Points and tangent vectors on M are represented in memory in exactly the % same way as the...
b22617a472fc2d9a5a99bdd1b7f3edab7800e7e69d8cd9b7a17ccd0fe32d8eb6
MATLAB
5,615
174
%=============================================================* % * % run_1D_ST.m * % Version: 1.2 (created on 11 June 2020) * % AUTHORS: A.M. LaPole, M.J. Colebank, M.U. Qureshi, * ...
efe90839b372afbd19298c71c95d774963d7b1a58ad253d54ecb6b0b2aa1a5d1
MATLAB
5,616
144
function TS_CheckTimeSeries(whatData,whatID,doParallel) % TS_CheckTimeSeries checks calculation of feature values for a given time series % Specify the hctsa data file, and the ID of the time series to check against % the operations. % %---INPUTS: % whatData, the data to use (cf. TS_LoadData) % whatID, the ID of the ti...
29decd3c9e1dee98b76242c6b03be03df8e0fde1ca5875a6edfa0c2f595d897c
MATLAB
5,618
180
function [cognitiveX,BVstimProt,standardIndexSequence,hirf_ms]=generateCognitiveModel_fastButTrialsNeedToStartOnVols(sequence,stimDur_ms,trialDur_ms,nTRvols_final,TRvol_ms,nSkippedVols,monitor,scaleTrialResponseTo1) % this function generates a design matrix of hemodynamic response % predictors from a condition sequenc...
aa6b653768ba0ae6bde38a6a2eb5d564e3921feae290ffeaafc6964b3336ba1a
MATLAB
5,618
173
function Calls=SqueakDetect(inputfile,networkfile,fname,Settings,currentFile,totalFiles,networkname) % Find Squeaks Calls = table(); h = waitbar(0,'Initializing'); % Get the audio info audio_info = audioinfo(inputfile); if audio_info.NumChannels > 1 warning('Audio file contains more than one channel. Detection w...
519518e22cf89b36bbdd992bf8a8f549c5fbc2b02907d8f830eecb492a41fa15
MATLAB
5,620
146
function userOptions = defineUserOptions() % % projectOptions is a nullary function which initialises a struct % containing the preferences and details for a particular project. % It should be edited to taste before a project is run, and a new % one created for each substantially different project (though the % op...
6d6fa869bd58028ab7a060c323dd4727419c60f1faf619811672f21eb2a06c6c
MATLAB
5,621
147
function userOptions = defineUserOptions() % % projectOptions is a nullary function which initialises a struct % containing the preferences and details for a particular project. % It should be edited to taste before a project is run, and a new % one created for each substantially different project (though the % op...
ee2ecd76e69d21b525267823289083196f8a9de6ead1f4ab0ee623dd724aa794
MATLAB
5,622
172
% EEG_DECODECHAN - given an input EEG dataset structure, output a new EEG data structure % retaining and/or excluding specified time/latency, data point, channel, % and/or epoch range(s). % Usage: % >> [chaninds chanlist] = eeg_decodechan(chanlocs, chanlist); % % Inputs: % chanlocs ...
02bbe7f5756fe4fffbe31fc5dbf02d8ec578d1b8953b9eebacaee5a7d78aaf75
MATLAB
5,623
153
% Script demo_segment % Illustrates usage of segment for 3D and 4D images, and the additional % parameters available in the batch editor % % demo_segment % % % See also % Author: Saskia Bollmann & Lars Kasper % Created: 2019-12-01 % Copyright (C) 2019 Institute for Biomedical Engineering % Uni...
5606f46a520da0754a49f252c77a042d56a0d14e45b0bd0c24a6324f1a98f3cb
MATLAB
5,623
157
function c = tapas_hhmm_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the hierarchical hidden Markov model (HHMM) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Th...
62c40ac3ae6b36bbfdd520384a25ebd542e0a86252598253648416d7dbee73af
MATLAB
5,628
122
function [fname_spikes,fname_events] = cellid2fnames(cellid,filename,CSC_chan) %CELLID2FNAMES Convert cell IDs to data file names. % [FNAME_SPIKES, FNAME_EVENTS] = CELLID2FNAMES(CELLID) returns spike data % and event filenames for CELLID. % % [FNAME_SPIKES, FNAME_EVENTS] = CELLID2FNAMES(CELLID,FILENAME) uses % ...
02f078c4b7075e6e6e43cc038545278ad90d16b9bf1724bb3d397d59321aa23f
MATLAB
5,629
140
function [bandwidth,density,xmesh,cdf]=improvedSJkde(data,n,MIN,MAX) % Reliable and extremely fast kernel density estimator for one-dimensional data; % Gaussian kernel is assumed and the bandwidth is chosen automatically; % Unlike many other implementations, this one is immune to problems % cau...
05bae8f58a2cd2788461acda4092550e715a48803314a26225cb1fd1a3ed00ec
MATLAB
5,629
183
function f = DBGetFigures(query,varargin) %DBGetFigures - Get all figures that match given criteria. % % Open figures and get related information such as code used to generate them. % % USAGE % % f = DBGetFigures(query,<options>) % f = DBGetFigures(figures,<options>) % % query optional figure list q...
09ac0372f08352fb4330f1a549a2da3e527a1f43ac94482098138c8fd0911170
MATLAB
5,630
174
%=============================================================* % * % run_1D_ST.m * % Version: 1.2 (created on 11 June 2020) * % AUTHORS: A.M. LaPole, M.J. Colebank, M.U. Qureshi, * ...
700315131b39cfcd764a4ee049ff56983a42a6c45747bd3c74b335fddde2a18f
MATLAB
5,632
145
function [ons_secs, outliersHigh, outliersLow, verbose] = ... tapas_physio_correct_cardiac_pulses_manually(ons_secs, thresh_cardiac, ... verbose) % this function takes the onsets from ECG measure and controls for % outliers (more or less than a threshold given by a percentile increased % or decreased by upperTr...
290e60fdcaf04d0a78d59f6753e8fc92144ef94fa6a2b9d2b81bfdbe4253e859
MATLAB
5,634
144
% BIDS_IMPORTEVENTFILE - create EEG.event from events.tsv and optionally events.json files % % Usage: % [EEG, ~, ~, ~] = bids_importeventfile(EEG, eventfile, 'key', value) % % Inputs: % 'EEG' - [struct] the EEG structure to which event information will be imported % 'eventfile' - [string] path to the event...
9693f6cbf6f50a81372d9d78a5b0870e4b8e20ce54015144a716c6f76273d911
MATLAB
5,635
196
function out=icassoGet(sR,field,index) %function out=icassoGet(sR,field,[index]) % %PURPOSE % %Auxiliary function for obtaining various information from the %Icasso result data structure. Using icassoGet, you can return %information related to original data, e.g.: data matrix, %(de)whitening matrix, total number of es...
7da3eea8ccbc87f3bc7f5105e79243ed3c3aad9ef9681d45f567a6ae799cc657
MATLAB
5,636
127
% IMAGESCLOGLOG - make an imagesc(0) plot with log y-axis and % x-axis values % % Usage: >> imagescloglog(times,freqs,data); % Usage: >> imagescloglog(times,freqs,data,clim,xticks,yticks,'key','val',...); % % Inputs: % times = vector of x-axis values (LOG spaced) % freqs = vector of y-axis value...
9e686055399a8d1ce856130e5488d02e0d0a577bb748d2b5fb4e096cec3f2008
MATLAB
5,636
201
function [cl,han,surfhan] = plot_points_on_subcortex(DB,name,colors,condf, varargin) % [cl,han,surfhan] = plot_points_on_subcortex(DB,name,colors,condf, varargin) % % Extract and plot points for specific structure/structures. % % name input specifies structure to extract and plot on. Can be: % - 'brainstem-thalamus', ...
baa379bbbb63f0ba11fa3fb09d1ac2d9a99a1a9cb5d9b2b785573a7815477534
MATLAB
5,636
147
%% |nanimresize| documentation % The |nanimresize| function resizes an image using the Image Processing toolbox function % |imresize|, but first fills NaNs to prevent missing data along NaN boundaries. % %% Requirements % This function requires Matlab's Image Processing Toolbox. This function % includes <http://www....
cbd75c76c9641c564c6bd69ed5c3846151335af0b0e1418af7c96653f287e98b
MATLAB
5,636
131
% STD_READTOPOCLUST - Compute and return cluster component scalp maps. % Automatically inverts the polarity of component scalp maps % to best match the polarity of the cluster mean scalp map. % Usage: % >> [STUDY clsstruct] = std_readtopoclust(STUDY, ALLEEG, clusters...
04b5898dddef274e353d9ed55ed72c36d6051e103bc6c7365de804af35645833
MATLAB
5,638
163
function diffStats = simplenn_caffe_compare( net, caffeModelBaseName, testData, varargin) % SIMPLENN_CAFFE_COMPARE compare the simplenn network and caffe models % SIMPLENN_CAFFE_COMPARE(NET, CAFFE_BASE_MODELNAME) Evaluates a forward % pass of a simplenn network NET and caffe models stored in % CAFFE_BASE_MODELNAM...
5aca0e0f112e6366c0fc29581e3fa4b57d96a033b56f5555c9fd454a9ea33c8e
MATLAB
5,641
130
function out = SB_BinaryStats(y, binaryMethod) % SB_BinaryStats Statistics on a binary symbolization of the time series % % Binary symbolization of the time series is a symbolic string of 0s and 1s. % % Provides information about the coarse-grained behavior of the time series % % ---INPUTS: % y, the input time serie...
ac491ec72f6dbb5d7a3654c3b0862856c93c31428660aa95a9cc424e01370977
MATLAB
5,641
153
% POP_EVENTSTAT - Computes and plots statistical characteristics of an EEG event, % including the data histogram, a fitted normal distribution, % a normal distribution fitted on trimmed data, a boxplot, and % the QQ-plot. The estimates value are printed in a panel a...
6fc11fa74d0f94cedd3ac8a8376fb2b9384e884b08917c597dac65cbc1e58ad6
MATLAB
5,645
169
% EEG_LAPLAC - gives the laplacian for the data contained in EEG % for the values 1:stepl:end with electrodes position given by EEG.chanlocs. % Step must be a number between 1 and length(EEG.data) % The method used for computig the laplacian is the described by Perrin et al. % 1989 using a spline interpolation betwee...
b1d766c55f274bb4df570217d260ec585ffe0fcb573a9d0f17a764ff7a6cd5fd
MATLAB
5,645
168
function this = init_processing_step(this, module, varargin) % initializes next processing step by creating folders for version tracking, % shuffling data, and updating processing parameters % % MrSeries = init_processing_step(MrSeries, module) % % This is a method of class MrSeries. % % IN % module 'realign',...
f102b07a058b7e06a3287e6caf86317601a231f0e24bdb25d3021a3d521a03ba
MATLAB
5,649
180
function [pos,unit]=getpos(h,fmt,href,opt) % GETPOS Get graphics object position in a flexible way. % GETPOS(H,FMT) gets the position property of graphics object % with handle H, according to FMT that can be expressed using different % units. H must have a "Position" property. % % FMT is a char array con...
d5ae8a99992535f182e78694dd2e16b5671e336a52fc65a507d0cb3bf19cf6c1
MATLAB
5,650
143
function [] = plot_basic(xvals, yvals, name, pathstr) %% plot_basic plots worm tracks as cm values without any gradient information %% Make a plot with all the tracks, then save it. global info fig = DrawThePlot(xvals, yvals, name); movegui('northeast'); ax=get(fig,'CurrentAxes'); setaxes = 1; while setaxes>0 % loop...
74a55d696d56f99139abe8bcb5d5a25892f0f1edeb2aeedba952e5de21a410db
MATLAB
5,654
159
function [U, cost] = robust_pca(X, d) % Computes a robust version of PCA (principal component analysis) on data. % % function [U, cost] = robustpca(X, d) % % Given a matrix X of size p by n, such that each column represents a % point in R^p, this computes U: an orthonormal basis of size p by d such % that the column s...
43423a36816c8b337d50ddb8336cdf4616e0f6528b92084f03735709ba5a5a29
MATLAB
5,660
145
function [MRSCont] = OspreySettings %% [MRSCont] = OspreySettings % This function initialises default settings and variables required to % run Osprey. % % USAGE: % [MRSCont] = OspreySettings; % % OUTPUTS: % MRSCont = Osprey MRS data container. % % AUTHOR: % Dr. Georg Oeltzschner (Johns H...
88e92f8397677e24ffcf4ec7a8b4606308c3cdf251085ef28ca164aa24c649f9
MATLAB
5,661
147
function [meg] = read_ctf_meg4(fname, hdr, begsample, endsample, chanindx) % READ_CTF_MEG4 reads specified samples from a CTF continuous datafile % It neglects all trial boundaries as if the data was acquired in % non-continuous mode. % % Use as % [meg] = read_ctf_meg4(filename, hdr, begsample, endsample, chanindx) ...
276e18e999ddd981e12a0f64d024181eecedee39b59d4db86954ec58b5ee7f21
MATLAB
5,662
153
function download_atlas() % Cross-platform (Windows/macOS/Linux) atlas downloader - replaces % download_atlas.sh, which cannot run on Windows at all (no bash) and is % unreliable on macOS (its `readlink -f` call depends on a GNU coreutils % flag BSD/macOS readlink doesn't support). % % Downloads the CIT168, MuSus-100 a...
1a1e2f3cdd14577ee80891ddaef939fc71e7143bbb3aa3e9351dca64d7752571
MATLAB
5,665
189
function M = fixedrankfactory_2factors_preconditioned(m, n, k) % Manifold of m-by-n matrices of rank k with two factor quotient geometry. % % function M = fixedrankfactory_2factors_preconditioned(m, n, k) % % This geometry is tuned to least-squares problems such as low-rank matrix % completion with ell-2 loss. % % A po...
966146028a19b3df850dc425c82cde5e57941d5008a2acde165e0f71962f92f1
MATLAB
5,666
202
function [] = main(analysisName, jobID, testRun) % test run = false by default if nargin<3 testRun=false; end % add filepaths to matlab search path paths = addPaths(); % create output directory if ~exist(paths.outputs, "dir") mkdir(paths.outputs) end % get configurations config = getConfig(analysisName, tes...
7efbdbf50f412740fb877dc78ac4f03bc2a8c0e9bddd456bc165da12ba88040a
MATLAB
5,670
187
function M = poincareballfactory(k, n, gpuflag) % Factory for matrices whose columns live in the Poincare ball manifold % % function M = poincareballfactory(k) % function M = poincareballfactory(k, n) % % Manifold of k-by-n real matrices whose columns live in the Poincare ball. % By default, n = 1, which corresponds to...
1b845b76d653a6051ce2eef528bf90094e95054e97d0afa558fdc8d00ba123b0
MATLAB
5,672
137
function [k_fft2_wat_ref, k_fft2_wat_ref_no_k_zfill, k_sort_b4_2dfft] = process_wat_ref(this_file, k_zfill, seq_type) fprintf('\nReading water scan parameters.') [data] = loadRawKspace(this_file); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Determine dimensions of the acquisition %%%%%%%%%%%%%%%%%...
78f8c38b1088892101e35fc403dbb1d916d8e3640d4ff45a7de13e1a9f4fe208
MATLAB
5,673
149
clear; clc; morph_path = '/oak/stanford/groups/kalanit/biac2/kgs/projects/babybrains/mri/code/morphology_allparameters/'; addpath(morph_path) set_participant_information hemi= 'lh'; Correl_R1=[]; Correl_CT=[]; Correl_CU=[]; R1_data=[]; CU_data=[]; SD_data=[]; CT_data=[]; ALL_profiles_SD = []; ALL_profiles_CT = []; A...
6285724d727022aa3a494605a48c9a752919624de0ce7668af6725712b1e38ec
MATLAB
5,674
178
function plot_brain3D_wrapper(params, vals, plotInfo) % plots iEEG channel activations on 3D transparent brain model % (c) Jiri, Jan17 %% color maps clrmap.brain = gray(128); % colormap for brain (T1, T2, CT, ...) if isfield(params.plot_brainTopo, 'colorMap') clrmap.chnls = params.plot_b...
73c7bf093e94b0422efa7112592f0ed87685bd13ca19becc59a519a139cb444f
MATLAB
5,679
186
function scatter_hsi(pts_2d,stride,hsi_img,rgb_img,wvl) % % utility to scatter plot 2d data points that correspond to % pixels in an hsi image % % clicking on the scatter plot highlights the closest data point in the % scatter plot and in the rgb image and plots the pixel's spectra, % clicking on the rgb image highlig...
1a50f856e23d7aa157eb0159d3a683a50508c73beb36148752986a0d0b1ca077
MATLAB
5,682
167
classdef (Abstract) Environment % Environmental dynamical system to be modelled by reservoir. properties (Abstract) D % system dimension Ranges % range lengths and lower limits of system variables Params % ODE parameters H %...
c24cec3c60ece197b96f5a7517726088c28073531f562e64ec877eff702f38bf
MATLAB
5,682
140
function [type] = ft_headmodeltype(headmodel, desired) % FT_HEADMODELTYPE determines the type of volume conduction model of the head % % Use as % [type] = ft_headmodeltype(headmodel) % to get a string describing the type, or % [flag] = ft_headmodeltype(headmodel, desired) % to get a boolean value. % % For EEG the ...
d71ca0228edcd8d66f526bbe51575d9998438d68621233140111f798835626b6
MATLAB
5,683
130
%% pruneRunAll % Script which calls pruneGetVals for specifed pruning method (saves % having to repeat in every iteration of the preprocessing pipeline) % whilst saving the .nirs files % % SLB 15/2/24 clear; close all; %% Add relevant toolboxes to current path % Underneath parameter settings for ease of access to ch...
8a7d1c941690d454f076827e1eb69a6a4c53c6107213329bbcf09cfc9b3d9b1c
MATLAB
5,684
144
clear all global clut2b timetracesX_X ROI_map_X movie_AVG_X load clut2b % load list of files % cd distorted FileList_0 = dir('Sag_Pos3_1-51_001*_.tif'); % cd .. FileList = FileList_0;%dir('OB_4planes_paradigm1*_undistorted.tif'); FileListX = FileList; % for k = 1:numel(FileList) % FileList(k) = FileListX(numel(File...
0152dee9a0b15b90923285eb1b628761c342a0764416f53864c35ff4f33d8d93
MATLAB
5,686
148
function out = EN_SampEn(y, M, r, preProcessHow) % EN_SampEn Sample Entropy of a time series % % SampEn(m,r), using code from PhysioNet. % % Uses a compiled C version of the code if available, otherwise uses a (slower) % Matlab implementation (which can actually be faster for shorter time series % due to overheads ...
19925378fe14cfb2661db2b07791c6f0fc02fad87d4e9e6bae3f64d95eea6aea
MATLAB
5,687
147
%% %%%%% transfer all current ROIs to fsaverage files = {'floc-places'}; hemis = {'lh' 'rh'}; vals = []; % V x hemis x 8 x quantities for ff=1:length(files) for subjix=1:8 for hh=1:length(hemis) a5 = cvnloadmgz(sprintf('~/nsd/nsddata/freesurfer/subj%02d/label/%s.%s.mgz',subjix,hemis{hh},files{ff})); ...
cf0ab2c65059ec75b535ca03607799e86b99e4fac574e612c306c3872b08e9ad
MATLAB
5,689
151
function [X, y] = generateEventClassifierDataset(tank_location, timewindow, timewindow_bin, kernel_size, kernel_std) %% generateEventClassifierDataset() % generate dataset for event(head entry, avoid, escape) classifier % tank_location : string. location of tank % timewindow : [TIMEWINDOW_LEFT(ms), TIMEWINDOW_RIGHT(ms)...
ec0dc47d0e5177c01322065c558144590afdc93e498ee4c61565e200e7bfa6b8
MATLAB
5,690
168
function idx2 = get_spike_pos(input_sig, fs, orig_sig, params) % get_spike_pos computes spike positions from thresholded data % % This function computes the exact spike locations based on a thresholded % signal. The spike locations are indicated as non-zero elements in % input_sig and are accordingly evaluated. % % The...
ba3bbae28871c7b28d1a967afa7e9788d689da523b700be730dc11851035cf1b
MATLAB
5,691
127
function dendrogramConditions(RDMs, userOptions, localOptions) % Will generate a text-labelled dendrogram for each RDM in RDMs. % % dendrogramConditions(RDMs, userOptions[, localOptions]) % % RDMs --- The RDMs to be operated on. % RDMs is some kind of struct containing RDMs. It can be of % ...
ae66362b17ebd1c0cfd4f0749d75a3b318460c37c87814bccfb0c0055d95b932
MATLAB
5,693
182
function runQAMPERBatch(batchStruct) %,csv_outdir) batch_id = batchStruct.batch_id; DWIstruct = batchStruct.DWIstruct; % userCachePath = setUserCache; % batchPath = [userCachePath filesep num2str(batch_id)]; batchPath = fullfile(batchStruct.currentNiiPath,num2str(batch_id)); csv_outdir = batchPath; if ~exi...
b62e0cae7be68236a348c5caec634766552a2eabe22b034ecca3536dbdad9289
MATLAB
5,699
90
% Specialized analyses for FMAToolbox. % % Firing map and curves, etc. (place cells, grid cells, head direction cells). % % FiringCurve - Compute spatial firing curve (e.g. for a head direction cell). % FiringMap - Compute spatial firing map (e.g. for a place cell). % PhaseCurve ...
a29c7221f321c4a834a33fb14933e87019298d8a75cda4055277607ba10cd2b1
MATLAB
5,701
189
function [c, r, t, cpulse, acq_codes] = tapas_physio_read_physlogfiles_biopac_mat(log_files, ... cardiac_modality, verbose) % reads out physiological time series (ECG, PMU, resp belt) and timing vector for Biopac .mat % files % % [cpulse, rpulse, t, c] = tapas_physio_read_physlogfiles_GE(logfiles, ... % ...
cfe2d8cda4276b018a2def456d89284598f64f126d56624e46a2c09873f51a87
MATLAB
5,701
136
function hlp_worker(varargin) % Act as a lightweight worker process for use with hlp_schedule. % hlp_worker(Options...) % % Receives commands (string expressions) from the network, evaluate them, and send off the result to % some collector (again as a string). Processing is done in a single thread. % % In: % Options...
e533405a442dfcba1a5f8277994324a22aa7c844aa529aca53bf4d71f8819613
MATLAB
5,702
177
function [c, r, t, cpulse, acq_codes] = tapas_physio_read_physlogfiles_philips(log_files, cardiac_modality) % reads out physiological time series and timing vector depending on the % MR scanner vendor and the modality of peripheral cardiac monitoring (ECG % or pulse oximetry) % % [c, r, t, cpulse] = tapas_physio_read...
837edffdf77e8fcc078491d3fd9727ed22c005f083cb69a182a103c034e7e09f
MATLAB
5,703
136
function [ons_secs, verbose] = tapas_physio_read_physlogfiles(log_files, cardiac_modality, ... sqpar, ons_secs, verbose) % reads out physiological time series and timing vector depending on the % MR scanner vendor and the modality of peripheral cardiac monitoring (ECG % or pulse oximetry) % % [ons_secs, verbose] = ...
e34ae87f4f3ef2a63c0a80a4aa9c885c3dbc47f0691c11531a29d135ce4161f8
MATLAB
5,704
139
%% Create Dataset function [vals_PPIX_all, vals_PPIX_visible, vals_background_all, vals_all, ... vals_PPIX_all_test, vals_background_all_test, vals_all_test, labs_test, ... features_region3, tsne_data, tsne_labs] = FD_clVAE_CreateDataset(data_path) %% Load Data liquid1 = imread(fullfile(data_path, 'liq...
09f4d655f0b7b6fdb53f7663ef8889304b97f8e9ec0d44ea42e237a3d5440a6f
MATLAB
5,709
227
function R=surfing_suma_surfacefiles(specfn,trgdir,cpmethod) % Finds AFNI SUMA surface files, and optionally copies them to another % directory. % % [R]=SUMA_SURFACEFILES(SPECFN[,TRGDIR,CPMETHOD]) % INPUTS: % SPECFN: SUMA .spec file; or if a directory is given, then all .spec % files in that direc...
095fb9c1fa15e72d9036aaa1a282f275f78f0b436b81cd5f55bf9673d1bc2ec8
MATLAB
5,715
107
classdef McsCmosRecording < handle % Stores a single recording for HDF5 files produced by the CMOS-MEA % software % % The different data sources present in the file are represented by the % different properties of this object. Typically, a file generated by % CMOS-MEA-Control will only contain an Acquisition grou...
ee3659b08fd14d8715e3dfb8410c022d3f3130c00dd747adf4dc47d0be067536
MATLAB
5,716
148
%% WILL NOT WORK EXCEPT FOR CELIAN, ONLY AS A BACKUP %% Get data load('\\znas.cortexlab.net\Lab\Share\Celian\dataForPaper_ChronicImplant_stability_withQM_2024-11-08'); %% Define the rest recInfo = cellfun(@(x) split(x,'__'),recLocAll,'uni',0); subjectsAll = cellfun(@(x) x{1}, recInfo, 'UniformOutput', false); probeS...
94cfd34962d8aef66efbd7af531106c26dd6af7fd8df04ae45e50cd7c86d7ae0
MATLAB
5,718
189
function r = tapas_sampleModel(inputs, varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Samples prior values from the prior provided in the configurations of the perceptual and % (optionally) the response model and returns the implied belief trajectories...
c530a4a26be834ec47f339a6d8a22f662f23d4e04eaa2145522ff9c4fd1fc889
MATLAB
5,718
187
function [final_positions, overlap, fvf_historic] = process_packing(x0, d, gap, side, iter_max, iter_fvf, resolution) % author : Tom Mingasson % function that create the packing i.e disk migrations from intial positions disp(' ') disp('Packing in process...') disp(' ') N = length(d); fvf_historic = []; x = x0; progr...
8ce346155b733d9898666f5eac4789d0514efb1e07850a3972d865d6ca9ee57d
MATLAB
5,725
145
function [s, cfg] = ft_statfun_indepsamplesT(cfg, dat, design) % FT_STATFUN_INDEPSAMPLEST calculates the independent samples T-statistic % on the biological data in dat (the dependent variable), using the information on % the independent variable (ivar) in design. % % Use this function by calling one of the high-lev...
212af970fb015eeea36861757a6cbebe0619d5a5667d8c7b675fd70e47c15106
MATLAB
5,726
151
function [events, ECG_min, kRpeak] = tapas_physio_find_ecg_r_peaks(t,y, ECG_min, kRpeak, inp_events) % finds ECG-R peaks in a timecourse, if MR-scanner detection failed (esp. at high field >= 7 T) % % USAGE % [events, ECG_min, kRpeak] = tapas_physio_find_ecg_r_peaks(t,y, ECG_min, kRpeak, % inp_events) % % Give...
e970ceff299a233e2ff8e0543db1818531f4db6562782fd5f076743065d6f764
MATLAB
5,726
156
function [ data ] = nmri_parse_stimuli( subject, data, params ) % will parse the info_ markings (from subject) to estimate trial-based % stimuli markings % % Implemented for % Augen auf / zu % HV Beginn / End HV % End HV / Post-HV 90 Sek % ?? Hz / Aus % call the subject and params include nmri_include_read_ps %% Get...
7cddbd1bc456dbeaa4303680b44167b924bc9ec86a741835d8b511ebac829d2f
MATLAB
5,728
168
function [P,Label]=DiffAnalysis(op,file,molec,model,ds,M,S0,U,UT,RTI,radius,ax,NumAnalysis,fit) [color, MOLEC] = colorcodefunction (model, molec); %Define axes units and labels xlabstring=['Time [' UT ']']; ylabstring = [molec ' [' U ']']; str=[model ' Simulation']; p=gobjects(1,7...
a1b0717918923bc21bb06d347c0e50f962a1082031cc7bc7fac5151e694205fd
MATLAB
5,728
135
% Script demo_save % Shows how to save (image) data to one or multiple files (split!) % % demo_save % % % See also % Author: Saskia Bollmann & Lars Kasper % Created: 2016-09-22 % Copyright (C) 2016 Institute for Biomedical Engineering % University of Zurich and ETH Zurich % % This file is part...
bbad37d917f9e7a51f0291f1f5218acf601000f5a2aff9d2c22275e6d36de43c
MATLAB
5,730
149
function [Y,Info_all,proc_paths] = inscopix2mat(isx_file_names,varargin) %% input movies should be of the same size! spatial_ds_factor = 1; temporal_ds_factor = 1; dcrop = []; crop_x_offset = 0; crop_y_offset = 0; Y = []; save_path = []; num_planes = 1; get_info_only = 0; for v = 1:numel(varargin) if strcmpi...
298bd6389a2ab1f5a875da4393b1ebcd4af6de203b19812d7eb315cb9365e545
MATLAB
5,731
107
function [pnt, tri, srf] = read_bv_srf(filename) % READ_BV_SRF reads a triangulated surface from a BrainVoyager *.srf file % % Use as % [pnt, tri] = read_bv_srf(filename) or % [pnt, tri, srf] = read_bv_srf(filename) % Copyright (C) 2005, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtr...
e2afb34edfcd607365ba3d8a47574d49861032fee0aa7eae3eba4126a96a341b
MATLAB
5,736
143
function [pulseCleanedTemplate, pulseTemplate, verbose] = tapas_physio_get_template_from_pulses(... c, cpulse, halfTemplateWidthInSamples, verbose, varargin) % Computes mean pulse template given time stamp of detected pulses and raw % time series; removes outlier pulses with correlation to initial guess of % mean ...
db7af13b7f4c981c2ba61671dcc6d34aa8485011d15580c20c71de3766dde639
MATLAB
5,738
172
function this = read_gifti_file(filename, this) % Low level reader of GIfTI 1.0 files % FORMAT this = read_gifti_file(filename, this) % filename - XML GIfTI filename % this - structure with fields 'metaData', 'label' and 'data'. %__________________________________________________________________________ % Cop...
f31a40585d60fec57003e831da4edbe90572c88396f2593dbbc79f6ead4ec960
MATLAB
5,739
167
% EEG_MERGELOCS - merge channel structure while preserving channel % order % % >> mergedlocs = eeg_mergelocs(loc1, loc2, loc3, ...); % % Inputs: % loc1 - EEGLAB channel location structure % loc2 - second EEGLAB channel location structure % % Output: % mergedlocs - merged cha...
d4baf0bc1b884720dfe7305bfd790e8a9e517345f02c49da5fd5a65edecb1b8a
MATLAB
5,742
161
% POP_SIGNALSTAT - Computes and plots statistical characteristics of a signal, % including the data histogram, a fitted normal distribution, % a normal distribution fitted on trimmed data, a boxplot, and % the QQ-plot. The estimates value are printed in a panel a...
1edc3ee288dc533537710b18647f9006e6892794bef678f3d70b7199a229f096
MATLAB
5,743
156
%% function [chi, lambdaOptimal] = qsmClosedFormL2(localField,mask,matrixSize,voxelSize,varargin) % % Description: compute QSM based on closed-form solution % Ref : Bilgic et al. JMRI 40:181-191(2014) % : Bilgic et al. MRM 72:1444-1459(2014) % % Input % ----- % localField : local field perturb...
09d08c00ebecd065b59cc081146c9da38490160a1e63ccc0123d26c31b2988e6
MATLAB
5,744
157
function [f,J,D] = tapas_ceode_fx_erp(x,u,P,M, xtau) % [f,J,D] = tapas_ceode_fx_erp(x, u, P, M, xtau) % % Computation of the dynamical (state) equation for a neural mass model % (ERP model). Compatibile with continuous extension for ODE % methods. Adapted from spm_fx_erp.m (original function license below). % Function...
c5f5b9cbc45c2928711e15365163912e1e9d30f11b2e6798d7f3545cbe2c937f
MATLAB
5,745
198
addpath(genpath(pwd)); clear; clc; close all; % set the info of data % global path path = fullfile('./', 'data', './'); neuron = {'Or42a'}; title_str = 'Or42a-10-73pentanol'; % set the parameters about the filters lfilter = 937; %30s, at the time resolution of 32ms. lunstable = 1900; %depend on the output data. r...