sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
56ef4a93614a85beaa7dea9ada34305dd18207118107fe89177422b46fb60b43
MATLAB
9,282
52
close all clear variables clc %Varun Mannam %date: 24th Sep 2019 %calculate the PSNR on test-mix data no bn format long font = 14; size = 60; lr1=[31.0013994757380,38.5682173013864;32.4355944495239,37.0147119119919;30.8389376260123,38.5027520432416;30.1446963613668,37.4353527244578;22.8898419300006,32.0962535000397;25...
986867672e7a1e03e5340cacab81690e8d918a6af1757c0543c49ac49f0f7113
MATLAB
9,282
227
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function save_nii_hdr_bis(hdr, fid) if ~exist('hdr','var') | ~exist('fid','var') error('Usage: save_nii_hdr_bis(hdr, fid)'); end if ~isequal(hdr.hk.sizeof_hdr,348), error('hdr.hk.sizeof_hdr must be 348.'); end ...
a05f6a398c347873776781365f4659590f16124626d72531e9e025dd95208957
MATLAB
9,283
224
function Vo = spm_imcalc(Vi,Vo,f,flags,varargin) % Perform algebraic functions on images % FORMAT Vo = spm_imcalc(Vi, Vo, f [,flags [,extra_vars...]]) % Vi - struct array (from spm_vol) of images to work on % or a char array of input image filenames % Vo (input) - struct array (from spm_vo...
cc30dfd4a90ae1b18f4ee7bd2f5105703a22ae5e1615f3dea2dc99c170f705e3
MATLAB
9,288
213
function plot_population_vector_shuffles(bayesian) % Marta Huelin _ February 2020 % Plot comparison between global and rate remapping, and real data. save_path = 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Population_vector_analysis\'; cd(save_path) load('global_shuffle_population_vector_data_excl.m...
a81ca95b08fd701e760c9ebf708eb3eae79fbf8286498cfc56e5c5191a5c4aa8
MATLAB
9,300
226
function Optical_fitting_7694(ref, ret, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','To...
4a1d3fdd9b3484a775740541b9f43a2ad238956dbf19a6f3e3addae6a4123f2a
MATLAB
9,304
380
function ftab = de_ftab(xrs, mas, varargin) %function ftab = de_ftab(xrs, mas, [options]) %| %| For multiple-kVp X-ray imaging, we must evaluate functions f_m(s_1, ..., s_L) %| for m=1,..,M, where M is the number of kVp settings, %| and L is the number of material components. %| f_m(s1, s2) = -log( \int exp(- (m1(E) s...
7865240eccfee16d6a8f30a0b4eebced2fc4ae6242cc7ea0374700df993d97d0
MATLAB
9,309
212
function SBJ08h_HFA_plot_crRT_LME(SBJ, proc_id, an_id, model_id, stat_id, plt_id, save_fig, varargin) %% Plots LME beta time series per electrode % INPUTS: % SBJ [str] - ID of subject % proc_id [str] - ID of preprocessing pipeline % an_id [str] - ID of the analysis parameters to use % model_id [str] - ID of the...
f6b20094238e75ff3ca599af95eb3bd3fdd6d859aa180bfce8e34095ed73c7ce
MATLAB
9,310
195
clear all rec_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; spath = 'C:\Users\xscogno\Dropbox\SfN2019\Development\Rasterplots\L9M1\'; mouse='L9M1'; %Name of the animal load([rec_path,strcat('recording_dates_',mouse,'.mat')]); %% Data and runni...
e04a260ec4985987b03bbc7379b163974cd521c87a42513a6c382d0eb2768736
MATLAB
9,311
185
function all_regressors = select_and_prepare_regressor_data_for_subject_level_glm(subID,session,condition,all_responses,stim_streams, mean_stim_streams,vertical,vertical_stim_streams) %PREPARE_REGRESSOR_DATA_FOR_SUBJECT_LEVEL_GLM % Collects all regressors for the convolutional GLM from behavioural and stimulus data % %...
2530dd60c87ba9aafc34830b41beebeeec08ea264eb07eabaf1db1778e3ff3a3
MATLAB
9,313
241
function SBJ08a_HFA_crRT_mGLM(SBJ, proc_id, an_id, model_id, stat_id) %% function SBJ08a_crRT_mGLM(SBJ,an_id,stat_id) % Run GLM with sliding windows for given time-frequency analysis % Correlation with RT and regression of RT as confound supported % Model based on log fit to behavior: % reward prediction, s...
3633070d8793888339bb518fb46145f76bb5ab22098e30b562c0212ff1eae1e0
MATLAB
9,314
422
function fit = de_ftab_fit_exp3(xrs, mac, varargin) %|function fit = de_ftab_fit_exp3(xrs, mac, [options]) %| %| Fit to DE table fm(), suitable for subsequent interpolation / extrapolation. %| Uses a special experimental exponential model: % todo -log(sum_k p_k exp(-m_k . s)) % fit a 3-term exponential model that has...
e11213605f0f4881cf9914c5878479b6169d84524c332c828d7caba915a468f6
MATLAB
9,321
246
% bjli @ Feb 11 2023. % bjlistat@nus.edu.sg % refered to Z. Yao, J. Su, B. Li, and S.T., Yau, Manifold Fitting i_job = 3; Jobs = { 1, 'Visualization of the output';... 2, 'Boxchart of Comparision';... 3, 'Boxchart asymptotic property N Comparision';... }; job = Jobs{i_job,2}; switch job...
412e08bf43a8e92f1b2457f3605302addc2dcb5d07f28d9648427ab4a82d9596
MATLAB
9,328
255
function Bfg_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,ds,stitch) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; r...
a4741f50f15aeacfe7f3cd7be00bf183efc9e986e55269f86c6732e6d81fb43e
MATLAB
9,335
275
%% Analyzing Neural Time Series Data % Matlab code for Chapter 4 script B % Mike X Cohen % % This code accompanies the book, titled "Analyzing Neural Time Series Data" % (MIT Press). Using the code without following the book may lead to confusion, % incorrect data analyses, and misinterpretations of results. ...
6303858a993a348b408eb216f7d42a31c7caaff8dda769f801f5e4996dae0e2e
MATLAB
9,336
237
function SBJ11a_HFA_conn_mGLM(SBJ, proc_id, an_id, model_id, stat_id, conn_id, pmask, nbins) %% Set up paths if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end addpath([root_dir...
cf9a00df6fc31599eb1fb66bf1b86ec80bb00a5f3b9ebce3629e099ed69d9775
MATLAB
9,359
237
%% this file allows to create fit Z-spectrum data with BM simulation %%it also allows to fit single offset QUESP and QUEST formulaes %% 1.1A load XLS_qCEST file % this creates a stack of Z-spectra Z_x and teh parameters struct P [w_x, Z_x, P, rowname, Ztab]=LOAD_xls_qCEST_2_Ztab({'25degC'}); expname=Ztab{rowname,...
c60279b8d6bb8e36a97df54434ff3c138c6cf0fe85562b03c2b87e747e0aa243
MATLAB
9,361
160
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 MAP2 (270 Mouse) %vol(ch3, 0, 5000) 568 TH (111 Chicken) %vol(ch4, 0, 5000) 488 Caspase3 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(...
c5e2c2c2f50c36da2ed28f9f3eba25044a12194385f70daf13f442c8e2c4c2ae
MATLAB
9,378
182
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - MEG - Desikan-Killiany % Authors: MCC % Date: 21/03/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear; clc; %% To be updated root_path='/Users/marie-constance.corsi/Documen...
2ecd25d8a6f41c9c62ef64d8f6df3bfe13a0a914a06de9b411651e42ea88671b
MATLAB
9,379
284
%Extended data Figure 14 %% Ramp clear all close all number_seq=1; factor_v=[0.01,0.1,0.5,2,4]; fk=4; factor_t=factor_v(fk); g = 1.5; % Used to initialize the weight matrix N = 500; % Number of cells %Time vectors dtData = 0.0641*factor_t; % dt at which the data is sampled. Using the same dt that I use for calcium...
45dec19fe5121e03428793030a946ea8acfe54afb6275f7ff25c29c537f629c9
MATLAB
9,395
253
function [Dtf, Dtph] = spm_eeg_tf(S) % Compute instantaneous power and phase in peri-stimulus time and frequency % FORMAT [Dtf, Dtph] = spm_eeg_tf(S) % % S - input structure % % fields of S: % S.D - MEEG object or filename of M/EEG mat-file with % % S.channels - cell arr...
0d72eb09af3f93dc9589d2f824e8c5751827e5e3c4280c36efe8700ff37f54c3
MATLAB
9,397
358
function back = my_cbct_back(proj, cg, ig, varargin) % function back = cbct_back(proj, cg, ig, varargin) %| %| cone-beam backprojector for feldkamp.m %| in %| proj [ns nt na] cone-beam projection views %| option %| 'use_mex' 1|2|3 default: 1 mex with loop in mex %| 2 mex with loop in matlab %| 3 mex with "st...
327d35c92cf81f6aaa250733874dd0031b27ac6238b1f70cdf6e1e99ab8d7cb6
MATLAB
9,398
304
function varargout = pm_unwrap(varargin) % Unwrapping of phasemap % When measuring phase one cannot easily distinguish between e.g. a phase % of 182 degrees, and one of -178 degrees. One tries to distinguish these % cases by using neighbourhood information. So in the example above, if we % find that a neighbouring voxe...
3dc35dfd37a35473b6725eda89bab291b6eff8366c750dfc8f6941bb427cf515
MATLAB
9,400
217
function [self] = getDistByTimeSpike(self,condNdx,key,opts,plotFig) %% Set up the data % lump all kinematic changes caused by ORN activity into one category spkTrigKinNdx = find([cellfun(@(x) strcmp(x,'below'),key,'UniformOutput',true) |... cellfun(@(x) strcmp(x,'above'),key,'UniformOutput',true)]); % update t...
370a35833861aef2a110999c3c8a5ccbf9bd4435f458982c826b4aeb4f467f6a
MATLAB
9,407
258
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); listname=['targetRight']; cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{1}],[cn1{2}]}; condnames=li...
96a6c6610423bf7a9f52549931159cb56319b58a072038a96c67b4380c6d2344
MATLAB
9,413
150
% THETA SEQUENCES DETECTION AND DECODING % MH 2020 % Bins theta based on spike phases. Converts phase bins to time, and decodes entire tracks using the new bins. Then divides in theta windows % (peak to peak), and applies thresholds to discard the noisy cycles. Finally, split the theta windows based on direction % Load...
96f196cc8003f311881c8830e0d6c03d84796957d05d0f51c20c285de63489b6
MATLAB
9,417
230
function [Z, A, Ainvb, dia] = BMsolution(x0, xZspec, tspan, z0, y0, y1) % comments here % last change: 2014/04/02 by PS % BM solution solves the Bloch-McConnell equations stepwise % set kCA=0 and fC=0, if MT is disabled if x0(1,3) == 0; % (x0(1,3) = Sim.MT) x0(4,2) = 0; y0(15) = 0; end % set ex...
b56423a8ec135ee0ea60517bd6d57dfdf8ccc679babd53b222c7a778750860d2
MATLAB
9,418
261
function [EEG, misc] = c_TMSEEG_prepareForPreprocessing(varargin) %% this function does several miscellaneous data input tasks to prepare for other preprocessing % (implemented here to not duplicate this common code in multiple dataset-specific analysis scripts) % Main steps include: % - (If needed) Load data % - (If ...
51bb46b9df58291369575ca993f9ae3236c042865d8bb6bb69760c8aa23f0888
MATLAB
9,421
162
function parametersOK = checkCopulaExtractions(draws, mcmc, modelParameters, model, environment) % function checkCopulaExtractions(draws, mcmc, model, environment) % Checks if the parameters extracted by the copula at the end of the % identification are ok. % % Input: % - draws: a structure which contains the parame...
64936456e98da3ad23ed3987b27f9404de6d22261a544264e6bf9dd5419ac565
MATLAB
9,431
235
classdef Neuron < handle %NEURON A neuron. % % A neuron has a position within an image, color, list of potential % IDs, probabilities associated with these IDs, and methods to draw % it within a GUI. properties % Neuron position & color. position % neuron pixel positio...
3bb37e8786fda308edef785d5d7574d98cbbfb21ec94362b24aa5faf44ebf3bb
MATLAB
9,439
432
function [Gx, Gy, kxvec, kyvec, sx, sy] = ir_gen_spiral_vd(D, N, nl, gamp, gslew, dsamp) %function [Gx, Gy, kxvec, kyvec, sx, sy] = ir_gens_piral_vd(D, N, nl, gamp, gslew, dsamp) %| Subroutine for generating slew-rate-limited spirals. %| Returns length of resulting gradients, after adding downramp. %| Craig Meyer, Cop...
5e19fb0882393f5b2d890fbe0085115e45634a7c3e29842669a65dcb22eb45b1
MATLAB
9,440
226
function Optical_fitting_7688(ref, ret, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','To...
21ae030b3d5ac3b45d11649c39f3bd99ffada7dd1fa317e4df1046c224885e95
MATLAB
9,445
182
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - Analysi fatta sul dataset a disposizione - 20 soggetti - Sess. 4 - EEG - Desikan-Killiany % Authors: MCC % Date: 21/03/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear; clc;...
ea3c6274acedfc117d5c909ba3614b562b3f4a2828a411b51999de867527e321
MATLAB
9,454
205
function extract_replay_rate(epoch) % Looks at the exponentials curves representing the cumulative sum of events and finds the coefficients of the equation (A and B) % Parameters load('extracted_replay_plotting_info.mat') load('extracted_time_periods_replay.mat') PP = plotting_parameters; bin_width = 60; %1 min % S...
22f461073681498eeaca75a96a7fb1ba5ff6547dd6388a1be9e7137255b04e13
MATLAB
9,464
241
% bjli @ Feb 11 2023. % bjlistat@nus.edu.sg % refered to Z. Yao, J. Su, B. Li, and S.T., Yau, Manifold Fitting Jobs = { 1, 'Visualization of the output';... 2, 'Boxchart of Comparision';... 3, 'Boxchart asymptotic property N Comparision';... }; job = Jobs{i_job,2}; switch job case '...
bd81a94407ae7f4b83dfb3fe8f529e8e2122807024432d8eabe08dc173861fd7
MATLAB
9,492
389
function ob = Gsparse(arg1, varargin) %function ob = Gsparse(file.wtf | sparse | cell, options) %| %| Construct Gsparse object, either from a sparse matrix itself, %| or from the arguments that would be passed to matlab's sparse() command, %| or from an Aspire binary .wtf file. %| %| The Gsparse object overcomes some ...
2a438f5335216e4c15e2496dd3e36f9d50860b64753625d4d5ca6959d535d834
MATLAB
9,511
258
function [task] = runRPE(subNum,runNum) % % RUNRPE.m $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % usage: [ task ] = runRPE( subNum, runNum ) % % subNum && runNum are scalar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % dependencies: % % (subID)_rpe_inp...
03ae05f9552986ef780e93353a7f068febc5663b1a76dee736b41176a3495c79
MATLAB
9,513
216
%Uses either the Garvey et all method or the SD limit method %specify which method and if there are 50% algorithm checks %Inputs:app data, PreStimData, SelectedTrialsData, PreStim stdv, MCD or SD ('MCD' or 'SD'), varargin(OnsetFifty, OffsetFifty (boolean)) %Outputs: All Onset and Offset time for each trial function [A...
689c53d834d87a23a8d8506eb4471e52f87dd5a13475dbb8e4533cca54ee0750
MATLAB
9,519
175
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 TH %vol(ch3, 0, 5000) 568 Tuj1 %vol(ch4, 0, 5000) 488 MAP2 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[]) ...
05a2ec7f3902179108f09a8900cecb6e900fea7940e51c0cf75ff58a39a14974
MATLAB
9,525
308
%% Figure 3a & b (right panel) % this script rungs additional analysis required for the plots of figure % 3a & 3b. %% clear ft_defaults %% - SUBJECTS - %% % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OSL31', 'OSL...
7ae2c00f7afec09134086df2240f72f7e00109ccbec8706c5a8a4d2a2c9e2665
MATLAB
9,531
297
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
8c6f63758f6c7f4b76e70dcaeb7ca9d9b5cf0612d7ebd6484297ce8e5b9d1134
MATLAB
9,531
266
function Bfg_stitch_NC(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; result=t...
09b6b98746c0f5526d032b8163afa754e0f9434e3f8825bb534f97f4d2982fd8
MATLAB
9,532
219
classdef SuhDemo < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause methods(Static) function gt=Omip47_wayne gt=FlowJoTree.NewOrReuse(... ...
d6a13cc6e56334c08833ec8a0eec61bde02fbd67843408c9acecc59de9992651
MATLAB
9,535
266
function Bfg_stitch_6692(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; result...
01e40cf03e06dbb39d5a0f0f8b42f466b810ee14471a74d86d0af2e367646c90
MATLAB
9,537
252
function Mus_stitch_True(datapath,disp,mosaic,pxlsize,islice,pattern,sys) %%% ---------------------- %%% % function version of mosaicing & blending % input: displacement parameters: four elements array [xx xy yy yx] % mosaic parameters: four elemetns array [number of x tile, number of y tile, % ...
e2b77ae00a337b8cb1f7398f829c12f9390a81a6c3b7d1c35b186efae71aab21
MATLAB
9,541
267
function Bfg_stitch_8921(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-...
f38e6cb8323a6efc8210a2f6fcf22b9388b41644043862d30d27343436f16288
MATLAB
9,543
241
% Evaluation of S-BLIF model output in respect to the neurophysiological % experiments by Miller et al. (2011) JARO article as described in % Takanen and Seeber: “A Phenomenological Model Reproducing Temporal Response % Characteristics of an Electrically Stimulated Auditory Nerve Fiber”, % Trends in He...
00fd3cc1951aabe75fc97e5dc14e5a2d3c0c1d39f5c05379d0446043673d9a0b
MATLAB
9,553
159
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 Sox2 %vol(ch3, 0, 5000) 568 Edu %vol(ch4, 0, 5000) 488 Ki67 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[]...
6a531fee1d69b2dbd0eb666d97889e7eddd411eb2bc3432aaac8292812c4f2b1
MATLAB
9,553
243
function [outMeanRoughness,outSortedList,outRoughness,outRoughnessFreq,outUsedSection] = ... IPEMRoughnessOfSoundPairs (varargin) % Usage: % [outMeanRoughness,outSortedList,outRoughness,outRoughnessFreq,... % outUsedSection] = ... % IPEMRoughnessOfSoundPairs(inFiles,inPaths,inSection,... % ...
1399ab99a7fd05a36da94e430e2e582b4c9c4bfcef7870eed498fa4040d16b36
MATLAB
9,555
229
function plot_decoding_both_tasks(subjects,with_stats,analysis) %PLOT_DECODING_BOTH_TASKS Plot the results from object decoding, averaged over %all participants for both tasks (categorization and distraction). % %Input: subject IDs, with_stats (1 plot with stats, 0 plot without), %analysis ('object_decoding' or 'catego...
da77b607e37ecd265436e34c2a143ca3bd2df542278fb2cde1a856773ae54fe2
MATLAB
9,557
314
function [B Bgx Bgy Bgz] = makeB(ig, kg, varargin) %|function [B Bgx Bgy Bgz] = makeB(ig, kg, [?]) %| %| Create a Fatrix B operation of warping based on cubic B-spline %| %| in: %| 'ig' image geometry %| 'kg' knot geometry %| %| out: %| B fatrix operation for warping %| Bgx fatrix operation for warping %| Bgy f...
e55378a5107e9e0ee9009b9be2e850e085a757e283b0a26236b4df21f95b016a
MATLAB
9,558
292
% Save NIFTI dataset. Support both *.nii and *.hdr/*.img file extension. % If file extension is not provided, *.hdr/*.img will be used as default. % % Usage: save_nii_bis(nii, filename, [old_RGB]) % % nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m) % % nii.img - 3D (or 4D) matrix of N...
56364e9e5b6a2ad6cc64630eee94784e54d88d2bf2cc25f836346255d03ad700
MATLAB
9,568
250
% bjli @ Feb 11 2023. % bjlistat@nus.edu.sg % refered to Z. Yao, J. Su, B. Li, and S.T., Yau, Manifold Fitting Jobs = { 1, 'Visualization of the output';... 2, 'Boxchart of Comparision';... 3, 'Boxchart asymptotic property N Comparision';... }; i_job = 2; job = Jobs{i_job,2}; switch j...
3131d75235a5d553242da1b3cec90360032b63cef79ab6a0dea1f2fb4b90beda
MATLAB
9,583
268
function Bfg_stitch_7688(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-...
a6df45d4d0387bb4ef68258799a66341ba151f875e2371fd8cd40babf80b74d0
MATLAB
9,583
268
function Bfg_stitch_7694(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-...
f34383c82bcf49c6df7ad8876e33adfbc9fb46a9fc4461fcae81219d90a81203
MATLAB
9,584
268
function Bfg_stitch_PTSD1(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=...
31404df829c3465c638bc8a321af02c067c155855e565bcd421df5f8189a8ddd
MATLAB
9,595
213
clear all;%close all;clc fn_ext = 'cue_resp' % group_plots = 'yes' subj = '' cond = 'lure+' freq_range = 'deltatheta' fpass = [4 5] time1 = '0' time2 = '1' plot_type = 'magnitude' % main phase % magnitude lock = 'onset' %...
32c5c57b883af453f6bc57dd2094b7350e109df73795a77dd6893c619a0ad4ca
MATLAB
9,599
260
function physiologicalPlausibility = checkPhysiologicalPlausibility(data,modelParameters,draws,environment,model,sensors,mcmc,dss) % function physiologicalPlausibility = checkPhysiologicalPlausibility(data,modelParameters,draws,environment,model,sensors,dss) % Replays the given scenario defined by the given data. % % ...
763c46e0b0d8f8e3d899a91497aecd9662126046bf51de543b494e9ca628d9dd
MATLAB
9,608
181
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - MEG - Destrieux % Authors: MCC % Date: 21/03/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear; clc; %% To be updated root_path='/Users/marie-constance.corsi/Documents/GitH...
b9493d987149bc70d095dc607975d4e95c068ce84ef31a1e5d1a44a03aa11756
MATLAB
9,608
181
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - EEG - Destrieux % Authors: MCC % Date: 21/03/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear; clc; %% To be updated root_path='/Users/marie-constance.corsi/Documents/GitH...
e9c19905f9195b05148ac431a521e6d4c5a1a51cfff60bcff8d1bf6c67f56ec5
MATLAB
9,612
376
function ob = Gtranslate(mask, varargin) %function ob = Gtranslate(mask, options) %| %| Construct Gtranslate object for image registration. %| (Internally stores image-sized arrays so not very memory efficient.) %| %| See Gtranslate_test() below for example usage. %| %| in %| mask size(image) logical array of object s...
e766ba36a4dbec1405db9b59c87b71f7f1a8857df3e42ff6f6d3f2230268a3b0
MATLAB
9,623
210
classdef FlowJoUtil < handle % AUTHORSHIP % Primary Developer & Math Lead: Connor Meehan <connor.gw.meehan@gmail.com> % Secondary developer: Stephen Meehan <swmeehan@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause ...
fe92aa1f64f90e907f70c45d69a704fe2b55c1cdaf417136ca29bf2b43bab8bd
MATLAB
9,627
238
function spm_defaults % Set the defaults which are used by SPM %__________________________________________________________________________ % % If you want to customise some defaults for your installation, do not % modify this file directly, but create a file named spm_my_defaults.m % instead, accessible from MATLAB sea...
6ebc5943d7ee32d8f12ef9faef6eaff74e6d33b8b1fcb2295cf293707c6e35c5
MATLAB
9,643
253
function sync_vr_to_np_driftCorrect(data_dir, save_data_dir, session_name, tracklength, save_fig_bool) fprintf('Start syncing session: %s @ %s\n',session_name,datestr(now,'mmmm dd, yyyy HH:MM:SS AM')); addpath(genpath('C:\code\spikes')); addpath(genpath('C:\code\npy-matlab')); addpath(genpath('C:\code\AlexA_Library\'...
b095cc4b1eca548db530a437fcf0fa02651dd1b468b9add7c2197d65fea76aa5
MATLAB
9,646
255
function ellipse_t = fit_ellipse( x,y,axis_handle ) % % fit_ellipse - finds the best fit to an ellipse for the given set of points. % % Format: ellipse_t = fit_ellipse( x,y,axis_handle ) % % Input: x,y - a set of points in 2 column vectors. AT LEAST 5 points are needed ! % axis_handle - optional....
00ef56e2cab93ebef2a4d8ed5bcd6bd42b54da802c1a15e9d7ff739dd8933407
MATLAB
9,664
355
function [B, C, hk, zk] = mri_exp_approx(ti, zmap, LL, varargin) %|function [B, C, hk, zk] = mri_exp_approx(ti, zmap, LL, [options]) %| %| Build approximations to exponentials for iterative MR image reconstruction, %| generalizing "time segmentation" and "frequency segmentation" methods. %| This is a key part of the ...
02ed1f8a578b6b043fc4d24b6bae36e4d5fac9c281f7dfd236b79bc491b623ec
MATLAB
9,665
213
% PLOT SHUFFLE DISTRIBUTIONS FOR AVERAGE THETA SEQUENCES %MH 2020 % INPUT: % method: either 'quadrant_ratio' or 'weighted_corr' function plot_average_thetaseq_shuffles(method) sessions = data_folders; session_names = fieldnames(sessions); PP = plotting_parameters; % yn34 = [280,260,240,220,200]; % yn84 = [110,100,90...
5bac58ef6010afded4f248a1cdf2b008660bb48b05a6ef5433aa66da3ea667c5
MATLAB
9,667
227
classdef ieegStructClass % The ieegStructClass is a class for handling iEEG data with various operations. % It provides methods for common average referencing, band-pass filtering, high-gamma extraction, % normalization, permutation cluster analysis, and more. properties data % channels x ...
932d7f09ed4cc2da8f435c4b325e70c9887b7daa75e433188f0c5b013aebbb32
MATLAB
9,671
247
% sessions = dir('/Volumes/groups/giocomo/export/data/Projects/JohnKei_NPH3/fkm_analysis/fr_corr_matrices/*.mat'); sessions = dir('/Users/KeiMasuda/Desktop/fkm_analysis/fr_corr_matrices_noSpeedFilter/*.mat'); sessions = filterSessions(sessions, 'mec'); %% for n = 1:numel(sessions) try matPath = fullfile...
cd2366530fff15bc7f615ffe297e710f8879f93be572db0d3a5da4163720374f
MATLAB
9,679
254
function sendExperiment2Host(host, localFolder, keepRemoteFiles) % Copies the files of an experiment from the control computer to an % experimental computer such as a Raspberry Pi. The experimental computer % has to be reachable through a Windows share named OTBRToolboxShare; the % files go into the folder Experiment i...
aec98f8c60206ead94b00ca7f3caff57debd7095667a362c1828de3dfb5c9326
MATLAB
9,681
270
function ZF_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,ds,stitch) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % ...
c20007dbdf7b88bc1b363945c6db9ef5d1712eb8905cf24ce589451123a8161e
MATLAB
9,683
223
%% Experiment: Parameter Estimation for Real data % Description: % - Learn multiple structures with various regularizers (lambda) and % tolerance values % - Train the parameters with respect to each of the structure learned % in the previous step with various values of parameter estimation % regula...
15296b61db0c4bb13c64c3958188716d57977383cfd26bf6bffe564a73cd4102
MATLAB
9,690
212
function [FitAllParams, IC] = FitData(Input,config) % Zilong Ji, UCL, zilong.ji@ucl.ac.uk % Wrapper function % =================================================================================== %load configurations necessary for the script Model_Name = config.ModelName; if Model_Name == "sigma_nu" %simp...
f336177904f404756634d69481c737fcb421bd9931c722a0e968fc14a72ddc66
MATLAB
9,691
393
function psino = rebin_fan2par(fsino, sf, sp, varargin) %|function psino = rebin_fan2par(fsino, sf, sp, varargin) %| %| Rebin fan-beam sinogram into parallel-beam (or mojette) sinogram. %| (Also useful for parallel-to-mojette rebinning.) %| %| in %| fsino [ns nbeta (L)] fan-beam sinogram (or possibly parallel) %| sf ...
a26c793a2eb431e26948a85031c56b711870e1cf06a0d7e0e8f3a845ed1296ce
MATLAB
9,698
305
%function [] = DataGeneration() %% This code works correctly as of 230511, please do not change anything (SPW) clear all; close all; %-------------------------------------------------------------------------- addpath(genpath([fileparts(which(mfilename)) '\matlab'])); addpath(genpath([fileparts(which(mfilename)) ...
0a2d1d461709401035a4fe016c6933c85e19bea972c4acad40749c2b5ad4c4d7
MATLAB
9,707
261
function a=rdrawhd(d) % rdrawhd - parses MCS data header (version 1) (datastream method) % a=rdrawhd(d) parses MCS data header % To use this function data-files must be open already % (fid is input parameter). ChannelID is incremented by 1 % because the first channel sampled is 0, i.e. its index % in the sampl...
dfdb4250de60e7a7b3e387f04b77557cf0a0c7bce311b0e645c4b9d55867c557
MATLAB
9,722
253
%This is a companion script to the labeling GUI that allows you to plot %your data against your labels. %% Plot Mean Trace selected times PIS (GREEN) recTimes=cell2mat(label_struct.G_preictal_mean.labels); recTimes=recTimes(:,1); figure plot(t_2p,mean(data.Fc1Gdff_flt2),'color',[0 1 0]) hold on line([recTimes recTime...
c07b955b8212c0695876b7f2fe8691cb6d0c216bea31657caa6e88feccf4ad3e
MATLAB
9,730
219
function out = loadSound(sh, filename) % Load an audio file and hand it to the sound device for playback. % % The file is read, converted to the sample rate of the open audio device % if necessary, and stored inside PsychPortAudio as a ready to play buffer. % The returned struct is the handle you pass to controlSound t...
48976fb77d22b3dbe133450907f5747e93567e2b13caa7ed27a30b58c76191eb
MATLAB
9,737
353
function [B, C, hk, wk] = mri_fun_approx(ti, uj, vj, f1, f2, varargin) %|function [B, C, hk, wk] = mri_fun_approx(ti, uj, vj, f1, f2, [options]) %| %| UNDER DEVELOPMENT %| For certain iterative MR image reconstruction problems, we have %| signals of the form f1(uj ti) f2(vj ti), for some functions f1() and f2(), %| a...
7a45747ac890c7e7bf3274f3debf1dbb7d7aa35055cea9329fd3ae138d82432b
MATLAB
9,741
255
% description: % 1) plot ERP for both conditions in a desired region, % 2) plot region specific spectrograms w/ or w/o ERP removal % 3) plot ERP for a given chan, and mean(trials-ERP) in the same chan % 4) plot idividual trials and trials-erp % 5) individual channel PSD close all; reg = 'CA3' cue_responsive = 'yes' s...
90b0046b1a0e8b5ec679e5d7b2abf0a5b3569c28f51e2f71ed57fb28a531cbc2
MATLAB
9,742
274
%% Script to create output for Fig. 5 - receiver operating characteristic curve for proportional errors % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Using support vector machine (SVM) to classify two groups based on their % fitted parameters using an holdout strategy (60% training set 40% testing % set...
1f04ecaaa0d421100ed8b09ac71cdc96f47454da91083fe8ebc9a09431697fcd
MATLAB
9,753
319
function spm_eeg_review(D,flag,inv) % General review (display) of SPM meeg object % FORMAT spm_eeg_review(D,flags,inv) % % INPUT: % D - meeg object % flag - switch to any of the displays (optional) % inv - which source reconstruction to display (when called from % spm_eeg_inv_imag_api.m) %____________________...
d83890beb458ee4c3bdf09fa7ffdf0b45a1c9a2df7f7f1976fc15ef43101340c
MATLAB
9,760
168
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 Sox2 %vol(ch3, 0, 3000) 568 LAMINB1 %vol(ch4, 0, 3000) 488 TUJ1 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax...
d031a0c8926824511f69b88fa7186b1396c510bcc33a8986062b3a62d916ee54
MATLAB
9,763
192
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 MAP2 %vol(ch3, 0, 5000) 568 Sox2 %vol(ch4, 0, 5000) 488 TH %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[]) %% Segment Nuclei % ...
7fabef639044cbc43438efc7bab89e9fa129c5ab0c8c199c8055373dd6deb692
MATLAB
9,782
173
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 Sox2 %vol(ch3, 0, 3000) 568 LAMINB1 %vol(ch4, 0, 3000) 488 TUJ1 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax...
cee6156cd1807faf983a49dbb80d4f878fe5cf5a647c5a45f82d2b166f9d5fc3
MATLAB
9,783
209
% PLOT AVERAGE THETA SEQUENCE SCORES PER PROTOCOL FOR SPEED DATA % MH 2020 % Loads theta sequence scores per track and session ('quantification_scores.mat', from extract_sessions_thetaseq_scores.mat). % First plot - For each quantification method (quadrant ratio, weighted corr, line fitting scores and slope), % c...
3d670cdc2fc02d0a8139bbbc273662d5252f9ec65f1f3f66c46fba6bf48f8089
MATLAB
9,785
182
% LAP PRE SPIKE TRAIN CIRCULAR SHIFT % Disrupts temporal domain. Shuffle used when analysing laps separately % INPUT: % decoded_thetaSeq, directional_place_fields,theta_spike_count - data structs % track: current track ID being analysed % lap_id: current lap ID being analysed % num_shuffles: integer ...
d9209eca54bcb299c13c242212feae769f6aa9d5f84146947b703940d1936aaa
MATLAB
9,790
271
% NOTE: this script is meant to be run with the matlab GUI to make figures clear all % Add package to read NPY files into matlab addpath('/Users/askeller/Documents/npy-matlab/') % List the cognitive variables: cog_vars = {'PicVocab','Flanker','Pattern','Reading','Picture','List','CardSort','LMT','RAVLT'}; % Specif...
5346d4c8d246dd7229e04011745fe0b9733c38214139e1f0094a1f3cfa796c43
MATLAB
9,796
268
function R2_stitch_NC(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-4; ...
2bb91bffb97210eb8cdc6f65acd6bb94e51851c539f0227fa5e53984a530fe33
MATLAB
9,797
268
function R2_stitch_8921(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-4...
cb069835620cd3751a2fba6777b5f73faf10510de1869628cb33cb9248f93736
MATLAB
9,797
268
function R2_stitch_7694(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-4...
0f42420117a622eaa9c09b4ee536c362ac08d015a8a930b2ad3f147671dbaa26
MATLAB
9,809
231
%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION % DIS_rev2_fig_1 % Script to analyse data and produce Fig. 1 for: % Grieves, Shinder, Rosow, Kenna and Taube (2022) % The neural correlates of spatial disorientation in head direction cells. eNeuro % % USAGE: % MAP_generate_maps...
9a1b79ac4a7e63f05ba9e4429eef56e555b54dd885b38eb932d18f34caa95520
MATLAB
9,814
274
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 freeze...
8dbc710a8a7d67ab771169ffdf4b7ec8b8c47c3e8977c6be0793df473ca200fc
MATLAB
9,815
301
function [B,ndx,dbg] = natsortfiles(A,rgx,varargin) % Natural-order / alphanumeric sort of filenames or foldernames. % % (c) 2014-2023 Stephen Cobeldick % % Sorts text by character code and by number value. File/folder names, file % extensions, and path directories (if supplied) are sorted separately to % ensure...
303c3c142f980a56c92d1d07f1ddb3266373d222a330572d7c1a9b809309fff7
MATLAB
9,819
257
function varargout = dartel3(varargin) % DARTEL 3D image registration stuff % %_______________________________________________________________________ % % FORMAT v = dartel3(v,g,f,param) % v - flow field n1*n2*n3*3 (single precision float) % g - first image n1*n2*n3*n4 (single precision float) % f - second ...
4ce5d094d65f7c0b9d5ae147608a60abacf11228f134bee56e3b7f58c586f72e
MATLAB
9,826
267
function [FWHM,VRpv,R] = spm_est_smoothness(V,VM,ndf) % Estimation of smoothness based on [residual] images % FORMAT [FWHM,VRpv,R] = spm_est_smoothness(V,VM,[ndf]) % % V - Filenames or mapped standardized residual images % VM - Filename of mapped mask image % ndf - A 2-vector, [n df], the original n & dof of t...
5334b7127cc26754f6d3300904b73e6124cc4ef2d784a29cca498b9b292b842a
MATLAB
9,837
295
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
bc92142bcf089d4240d97f09a1615dcdedd1455325fed4744182a30429797039
MATLAB
9,844
255
function SBJ01b_align_nlx_evnt(SBJ, proc_id, block_ix, save_it) % Load, resample, and align photodiode from neuralynx system to clinical data % INPUTS: % save_it == 0: don't save plots, compare to raw data % == 1: save plots and data, compare to import % OUTPUTS: %% Load, preprocess, and save out photodiode ...
871e255016b608e351c681996acf9b49ef91287b21efad5c6ef1fc7f180383bb
MATLAB
9,845
181
% GET PLACE FIELDS WITHIN LAPS % loads list_of_parameters.m, extracted_clusters.mat,extracted_position.mat, extracted_waveform.mat % uses function extract_laps.m, skaggs_information.m % INPUTS: % track_id: track being analysed % lap_start & lap_end: set laps to analyise by inputing start and end lap IDs %...
bdfdeeb4c1049dd7f0734523577d4fbd5dcb4745206db0994d31a59370c9c35d
MATLAB
9,854
202
function gap_linking_str = fun_graph_get_linker_ep2skl(vessel_image, vessel_mask, vessel_skl, ep_sub, ep_all_sub) % fun_graph_get_linker_ep2skl use threshold relaxation and shortest path on % designed metric to find a 3D line segment that connect the inut endpoint % to a skeleton voxel in the nearby connected component...
5ea024bb63a37e93b1b431119b09aea132dbd1409ab660641a60bca1a2c7a13b
MATLAB
9,858
286
clc;clear;close all; root='..\'; addpath(genpath([root,'NeuralCorrelateEvidenceAcc'])) %% settings -------------------------------------------------------------- subdir='total'; clusterName='clusterArea_paper'; regCluster=1; if(regCluster) subdir=[subdir,'_',clusterName]; end shuffel=100; type='dp';%cp,dp,contra a...