sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
dab92b39367c5522dbbef5552787b1c4d19599359331122995d5877028b1112f
MATLAB
3,811
84
function [ overcomplete_params ] = samples_to_overcomplete(samples, adjacency_matrix) %CONVERT_SAMPLES_TO_OVERCOMPLETE This functions uses the graph structure %and the samples in its simple format (one sample per row, one variable per %column), and converts the samples to the overcomplete parametrization %necessary to...
eb1a2f16cceb07e984e65815cfe69d88a8330d2d58cce543aa38fcf1afb92a22
MATLAB
3,811
110
my_cells = readtable('/Volumes/groups/giocomo/export/data/Projects/JohnKei_NPH3/F1/F1_190620_johncontrasttrack_train1_sp_cells_by_eye.xlsx'); my_cells = table2array(my_cells); sp_cells_st = struct('cell_number', [], 'fr', [], 'MI', [], 'early_trial_normalized_correlation', []); sp_cells_st.cell_number = my_cells; f...
341a85444c010509d9dade03a0d0f96a42dbc8523703c7674011081865b30882
MATLAB
3,814
150
% ir_ct_fan_beam_os_rlalm.m % compare FBP and relaxed OS-LALM for a 2D fan-beam CT problem % see ir_pwls_os_rlalm.m % 2015-11-30 Hung Nien if ~isvar('A'), printm 'setup geometry, image, sinogram' f.down = 4; ig = image_geom('nx', 512, 'fov', 50, 'down', f.down); ig.mask = ig.circ > 0; sg = sino_geom('ge1', 'units'...
af30156b6ffac73a6807a14da0327bd53c1c60ceb5511b627d8a9283427ce006
MATLAB
3,814
122
function [xCent,yCent,distByTime,perAtBound,radialOccupancy,r,tt] = ... plotRadialPosition(self,border,cond,plotFig,varargin) % default values dt = 2.*self.fs; dr = 0.2; fe = self.getFirstEntry('H',border); tMax = self.nPt./2; clims = [0 1]; stopThresh = 0; xrange = [0 tMax];yrange = [0 4];nOvlapX = 2*dt/4...
56dccbfd97ce1b6c6667567436917cbcf0bc09896547bf0c57a664c9c76c50a7
MATLAB
3,815
115
function wkwBenchmark(param) [wkwFile, wkDir, cls, sz, testFilename1, testFilename2] = buildData(param); wkwCompFile = strcat(wkwFile, '.lz4'); sizeVec = 2 .^ (0:log2(sz)); sizeCount = numel(sizeVec); repCount = 20; disp('<< Running benchmark'); data = nan(sizeCount, 5, repCount); for...
1c368d4c20c52931e8fffe05bbe703d6100aee0d470b9b1dc2affca9ec0aaa1b
MATLAB
3,820
94
% compile % % Builds the trigger counter for keyboards (triggerCounter3.m) into a % standalone Windows program with the MATLAB Compiler. % % Run it in MATLAB, from any folder. Needs the MATLAB Compiler and % PsychToolbox; the toolbox itself is not needed. The program is written to % the subfolder build, together with t...
d89c1fe9ba8e6545efb0db5cde12be74b84a3176e90ec6e60e448e6a5ae8d0d9
MATLAB
3,822
76
function [input_graph, undeleted_info]= fun_graph_delete_dim_short_link(input_graph, link_label_to_remove) % fun_graph_delete_dim_short_link removes the links specified by the link % label. If delecting the link result in creating a endpoint, this link % will be skipped. %% Remove th_hair_length = 0; num_link_to_remo...
f5b23d855f174316135a4c5fc77b6e353d5ab8aec17485ac701f1cd79101645d
MATLAB
3,822
85
function compute_num_epochs_final(study_info) pipeline='NEARICA_behav'; % Number of subjects n_subjects=size(study_info.participant_info,1); subj_lext_trials=zeros(n_subjects,1); subj_ftge_trials=zeros(n_subjects,1); subj_exgc_trials=zeros(n_subjects,1); subj_exend_trials=zeros(n_subjects,1); subj_lobs_trials=zeros...
2c54f54b5f946510b87ec19337721fba43677c12a6e1d3163d86e259ea37dc50
MATLAB
3,823
117
function p = userpath(inArg) %USERPATH User environment path. % USERPATH returns a string specifying the first folder on the search path. % MATLAB adds the userpath to the search path upon startup. % % The default userpath is platform-specific: % Windows: user's "Documents" folder appended with "MATLAB" % ...
55a17abda44899f692d60dab22fcf569b68c48e4c621f9e7a048d054e134428d
MATLAB
3,824
154
function xs = tpl_osps(x, Gb, yi, bi, ri, P, niter, pixmax, curv, gi, denom) %function xs = tpl_osps(x, Gb, yi, bi, ri, P, niter, pixmax, curv, gi, denom) % The T-PL-OSPS algorithm for transmission Poisson problem % (ordered subsets separable paraboloidal surrogates) % Input % x [np,1] initial guess % Gb Gblock sys...
b8fdede1bcaf9e4ade301926a5497c95b58b29333cf4357be01df7174758b8e4
MATLAB
3,824
105
% Plots ratemaps from 16 to 1 laps for the best and worst rat function plot_track_place_fields_thesis cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Combined_figs' axes = Protocols_rate_maps_makeFigure; sessions = [{'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\P-ORA\P-ORA_Day5_16x8'},... {...
5bb68f7e78287da4124fcbb6872628cc8e5518fc29d42ca8ff50b5ada133972a
MATLAB
3,825
132
function proportion_phase_precessing_place_cells sessions = data_folders; session_names = fieldnames(sessions); PP =plotting_parameters; c = 1; for p = 1 : length(session_names) folders = sessions.(sprintf('%s',cell2mat(session_names(p)))); for s = 1: length(folders) cd(cell2mat(folders(s))) ...
6e66fe70438474df0f56eae184dc33fdedebfbe8cfaf3308330af3d7d8ff586e
MATLAB
3,829
95
function [self,stateDistBefore,stateDistEarly,stateDistLate] = getBaselineKinematics(self,condNdx,key) %close all spdAll = self.calcSpd; % separate the track into combinations of state and condition [condState, stateKey] = self.getCond(condNdx,key); nCondStates = size(stateKey,1); nState = numel(self.states.key...
b1033cb9e9c10645e131f3e3ce2782e44fef97b444e4be1a9450fa64634975ad
MATLAB
3,830
148
b1 = repmat([0 25 50 100 150 200 250 500 750 1000],[1 10]); b2 = [zeros([1 10]) 25*ones(1,10) 50*ones(1,10) 100*ones(1,10) 150*ones(1,10)... 200*ones(1,10) 250*ones(1,10) 500*ones(1,10) 750*ones(1,10) 1000*ones(1,10)]; gradechoinv = nan(length(b1),8); gradechoinv(:,4) = b1; gradechoinv(:,8) = b2; %blood d1 = 0.02...
c0b902aac6923ac9bcadfb1658d15c1e73731592cd4f1b654f08e59c4378afa6
MATLAB
3,830
81
function connect_link_str = fun_graph_shortest_path_through_3pts(metric, ep1_sub, mid_sub, ep2_sub, connectivity) % fun_graph_shortest_path_between_points finds the shortest path between % two point, with distance measured by the metric array % Input: % metric: 3D numerical array, specify the distance between neigh...
189ded33eb070d64944e07eec6c9907796c492116d3fce69289ea219c8023a78
MATLAB
3,831
85
close all; clear; clc; saveFigure = 0; load('SpearmanCorrFullyShuffled.mat'); subjectColors = [rgb(106, 27, 154); rgb(239, 108, 0); rgb(46, 125, 50)]; figX.fig = figure('Name', ''); set(figX.fig, 'Units', 'pixels', 'Position', OSScreenSize([10 6]), 'NumberTitle', 'off'); figX.ax1 = axes('Position', [.05 .15 .425 .75]...
b8a30d18990eb5267b9b00af0bb58154a7c380e961c4bf89a5250bfa726818e9
MATLAB
3,833
143
function [ci_95, ax] = bland_altman(y1,y2,varargin) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here p = inputParser; p.addParameter('in_path', pwd, @ischar); p.addParameter('RecurNum', 1, @isnumeric); p.addParameter('BlackList', {'user_prefs', 'images','.hg','config\d*','deploy'}, @is...
9c71be74a12a51b63d35efd02c2a807e078f18afecef499ed28933d56464cad4
MATLAB
3,834
177
% clc % clear all % close all set(0,'DefaultAxesFontSize',20); % b=0.1;%Fading rate % c=0.08; % acquisition rate % A=(c/b)^(b/(b-c))-(c/b)^(c/(b-c)); % %x=0:0.1:400; % F=(exp(-b*x)-exp(-c*x))/A; %plot(x,F,'b','LineWidth',2);hold on %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% V=xlsr...
229b992bee86b6e8dfb224e9092ed3f9faa445fba7c1d37022fb55e6581f174b
MATLAB
3,835
94
function SulciMap = tess_sulcimap(sSurf) % TESS_SULCIMAP: Compute a sulci map based on curvature and connectivity. % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2016 Univ...
38863fb31494d9b1aa89692dfc5512ed288d344fd6c6e73269b4cd6b62221987
MATLAB
3,843
120
function eeg_interped = removeBadChannels(eeg, chanlocs, rejectedChannels,highThreshold,lowThreshold) % This function identifies and replaces bad channels with a spline % interpolation of all other channels. % Dependencies: EEGLAB. % % Input: % eeg - eeg data (time x channel) % chanlocs - channe...
cc0a4794a41cd9b66703a976ece62ef30c94268bee5605c175400c59ea746ac8
MATLAB
3,847
84
datapath='/projectnb2/npbssmic/ns/myelin_content_scattering_correlation_paper_data/cerebellum/'; % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbss...
5c520f42ae8c5eaf109cdc498662641647b5341c7b0c0cf4fbf43116426fd99c
MATLAB
3,850
123
function img = myFeldkamp(cg, ig, proj, varargin) %|function img = feldkamp(cg, ig, proj, varargin) %| %| FBP reconstruction of cone-beam tomography data collected with %| a circular source trajectory. %| See feldkamp_example.m for example. %| %| in %| cg ct_geom() %| ig image_geom() %| proj [ns nt na] cone-beam ...
0dcd6df05e20d2cd968686ad5b0429fdf8317d169284a033e2133e1005390142
MATLAB
3,852
80
function out = defineExtraEventCodes(in) % This function creates predefined event codes and stores them in a variable. % This variable can be used together with the sendEvent function to conveniently % send indivisual events to e.g. electrophysiology hardware. % % If these functions are used, the following agreements m...
e705696aa9e573d9a3e0433fd3684b31c6420beb1b53284b5c0779b21abfd774
MATLAB
3,853
104
% The script is used to perform wholw-brain searchlight decoding on fMRI data % add toolbox addpath(genpath('spm12/')); addpath(genpath('CoSMoMVPA-v.1.1.0/')); addpath(genpath('libsvm-3.25/')); %% trasform beta maps into MNI space % set input and output paths beta_path = '../../mri_data/beta_map/'; save_path = '../.....
155ae7c3892c935237dfab553f4ce5d2cca168e58526750d49433850c47bf70e
MATLAB
3,856
87
classdef phonemeSequenceTrialParser % The phonemeSequenceTrialParser class parses phoneme sequence trial information. properties syllableUnit % Syllable unit (1 - Consonant, 2 - Vowel) phonemeUnit % Phoneme unit (1 - 9: a, ae, i, u, b, p, v, g, k) phonemeClass % Phoneme class (1 - 4...
5304352ca6368db059b2728e8991bfb87b7718c6f9fd21c0a8e6d4e61b382eaf
MATLAB
3,857
178
% mri_superres.m % NOT DONE! % % Explore super-resolution in MRI with rotated propeller sequences % Inspired by Benoit Desjardins' work. % Copyright 2003-7-23, Jeff Fessler, The University of Michigan % % create k-space samples, in units of 1/mm % if ~isvar('kspaces'), printm 'setup kspace' fov = 256; % [mm] typical ...
28eaeb76ab9491f0e2ebc1ef90d31a71e24b51823f3ca9cec16cf76ee5c60fdb
MATLAB
3,858
95
function [CustomAnalysisOpts, UserVar] = createAnalysisPluginFigure(existFig,appCustomAnalysisOpts, PluginsFolderName, numVar, ListofVariableLabels, PluginName, DefaultValues) settingsFile = fullfile(PluginsFolderName, [PluginName '_Settings.mat']); existSettings = isfile(settingsFile); CustomAnalysisOpts=appCustom...
75e648f69d023b51f617a618eeb02f540f4e6770621e09087f91386e85ec2541
MATLAB
3,859
119
From smalone@engin.umich.edu Wed Jul 15 13:37:52 1998 To: "Jeffrey A. Fessler" <fessler@eecs.umich.edu> Subject: Re: pwls_sor Prof. Fessler, I'm sending along two of my pwls_sor routines. Both compute one iteration of the routine. One uses precomputed diag[G'*W*G]. The other does not. I could combine the two, if y...
022788f3a298b76516149ea5c9cfe1c5a569bbaab997841abe9152f1026ac5ef
MATLAB
3,860
100
close all clear variables clc %Varun Mannam %date: taken from 29th Sep 2019 %date: 7th June 2020 %DnCNN model with diff lr in keras %calculate the PSNR on test-mix data raw nbn (with -0.5 subtraction and 200 %epochs) %lr1 = 1e-3, lr2 = 1e-4, lr3 = 5e-4, lr4 = 5e-5, lr5 = 1e-5 format long font = 14; %data addpath('/Us...
8567d65cf794e337f132628a210e1b1e78d4650eaaf36cdf55a9a54ce3437c76
MATLAB
3,860
86
% CHAPTER 2 PIPELINE % Marta Huelin % REPLAY TIMES AND QUANTIFICATION extract_replay_time_periods(computer,data_folders,data_type,[]); extract_replay_plotting(computer,data_type,replay_control); merge_sleep_rest_replay(multievents,bayesian_controls); % Raster plot with replay event times raster_replay_times('awake');...
98e9fcffa7069844b198a432c335c691acc1d5f22061fcced90aa20d28e886af
MATLAB
3,861
116
function [eeg_timelock, data_trials, trials, indx2, ibi2, overlap] = compute_eeg_segments(data_eeg, indx, time_onset, time_offset, maxamp) % This function computes timelocked EEG segments to random timings. This % function emulates what is done in the function compute_her.m and random % timings are considered as heartb...
b281bcf821272e6bb46ba770f19b6c00d4538963d0378e7d536cb145ff0461ad
MATLAB
3,861
117
function neural_prediction %NEURAL_PREDICTION Neural prediction example. % NEURAL_PREDICTION loads an example dataset and trains a forward % encoding model (TRF) that predicts 128-channel EEG responses from 2 % minutes of speech as per Crosse et al. (2016). % % Example data is loaded from SPEECH_DATA.MAT and c...
fba0a758476be0031b0d00277e27f18c57fe6bc2a8e672f7974854ff35d31fc7
MATLAB
3,861
122
function [H, HC] = spm_browser(url,F,pos,format) % Display an HTML document within a MATLAB figure % FORMAT H = spm_browser(url,F,pos,[format]) % % url - string containing URL (e.g. 'http://...' or 'file://...') % F - figure handle or Tag [Default: Graphics] % pos - position within figure in pixel units with...
100433f024634f2af66ed5810a870d5ff30a263b503275c82bd707ea23ee213a
MATLAB
3,862
92
function [linker, paired_ep_ind, found_idx_str] = fun_graph_get_linker_for_int_link(vessel_image, vessel_mask, vessel_skl, int_link) % fun_graph_get_linker_for_int_link use threshold relaxation to find the % linkers for internal link with endpoints. % Input: % vessel_image: 3D numerical array, image stack % vesse...
4e589ffd164357ed3630bfa6b773d54826c765577c926059669dcb67e0851f33
MATLAB
3,863
113
function [ix] = spm_fieldindices(X,varargin) % Returns the indices of fields in a structure (and vice versa) % FORMAT [i] = spm_fieldindices(X,field1,field2,...) % FORMAT [field] = spm_fieldindices(X,i) % % X - structure % field1,.. - fields % % i - vector of indices or fieldname{s} % % Note: Fields...
65c63959a9e26f4a9184ca8153b6f54b40682aa475f39d9c4b9e05503b75bb7d
MATLAB
3,865
98
% LEARN_STRUCTURES_BY_DENSITY % ADOPTED AND EDITED BY DARIK ONEIL YUSTE LABORATORY 11/19 %% Documentation %function input is: %x_train: logical, binary matrix i = time and j = node %densities: vector of densities to be tried %variable groups: optional cell array that marks which variable belongs to %each group to...
f3d554d6552f93a63715fccaf8e2bbcaf52c6a467226189519790268bfbc9624
MATLAB
3,865
119
% SENSE_homodyne_recon_demo.m % demos use of SENSE_homodyne_recon.m, which combines % SENSE and partial Fourier reconstruction. Input image can be rectangular, % but both dimensions should be even % % resulting figure shows the improvement from demodulating with the % reference image and compares MSE to reconstruction ...
f4f2e38304454441863e50c7fa9d1033fbd8e0a0e552ee82dcd69c481be92106
MATLAB
3,872
107
function F = spm_Gcdf(x,h,l,tail) % Cumulative Distribution Function (CDF) of Gamma distribution % FORMAT F = spm_Gcdf(x,h,l,tail) % % x - Gamma-variate (Gamma has range [0,Inf) ) % h - Shape parameter (h>0) % l - Scale parameter (l>0) % tail - if 'upper', return the upper tail probability of the Gamma % ...
19057c41d93ca7082ab0d828fbc4e4dc4de20b91030ab22c2d0a5397d82eb7ee
MATLAB
3,873
88
function analyze_opto_Fig6 rootdir = 'C:\TKlab_agingPFC\'; cd(rootdir) load behavior_opto num2stimperiod = {'whole delay','early delay'}; shade_color = [0 1 1]; FaceAlpha = 0.3; figure;hold on for stim_period =1:2 if stim_period==1 off_ustim_y = CR.y_off_whole_ustim; on...
9cbfb49c232e8d956738775152af8caf11f429ee190a83449a1c1e429d74ef7b
MATLAB
3,874
79
function pm = pm_merge_regions(pm,rima,ii,jj,nn,pp,rs) % Merges regions as defined in connectogram to minimise % total costfunction (sum of phase-differences across % region borders). % FORMAT: pm = pm_merge_regions(pm,rima,ii,jj,nn,pp,rs) % % Input: % pm : Phase-map % rima : Label map consisting of connect...
e42a6b0d56e1d4063b505f7443919619573f08393a2e3b3b4c701e9732cf4ee8
MATLAB
3,874
109
function [] = SVD_embeddingAnalysis(f_orco,meta,figureFile) % SVD_embeddingAnalysis Compares state space dimensions from taking % derivatives vs from truncated SVD. Uses the false nearest neighbor % algorithm to determine embedding dimensions % % Inputs: f_orco = a fly object % meta = a structure with...
e48bdb9bb7c31d50962485e4ad960418ebabafdb340d7f68bf4f0533737908e6
MATLAB
3,877
86
function [OoBInfo] = CalculateOoB(FlagPos, TrigPos, OutOfBoundPos, CondTable) %% CalculateOoBTrials % Andrea Castegnaro, UCL, 2022 uceeaca@ucl.ac.uk % Further preprocessing for OoB trials. If out of bound (OoB) trial % we set the return distance as the mean value of all good trials for that % environmental condition....
461853318f741741d017a488db29131de6c372608947a6c2f170a5c0af9672f7
MATLAB
3,879
95
% Script reproducing the results in Table 1 of the paper: % [1] M. Mäkitalo and A. Foi, "Optimal inversion of the generalized Anscombe transformation for Poisson-Gaussian noise", IEEE Trans. Image Process., doi:10.1109/TIP.2012.2202675 % % Alessandro Foi and Markku Mäkitalo - Tampere University of Technology - 2011-20...
adeef8aa3abb42cc603e8c65b4bacdf010a7fd4789f3c62302eaa72cb76d56c6
MATLAB
3,879
88
function [I_frame] = fun_calcROIoverlap(handles, slice_idx) %FUN_CALCROIOVERLAP Summary of this function goes here % Detailed explanation goes here cc = fun_HSVcolors(5, 1); I_stack = handles.imageI; G_stack = handles.imageG; S_stack = handles.imageS; if get(handles.Check_AutoI, 'Value') ...
d63cbc648294c608fee07d244ad917a2b17ddaab1de420b27d493c47c018f963
MATLAB
3,879
103
function significant_timepoints = fdr_correction_dth(subjects,task,category) %FDR_CORRECTION_DTH Perform permutation tests + FDR correction on the p-values to calculate the %significance of the timepoints in the distance-to-hyperplane analysis. % %Input: subject IDs, with_stats (1 plot with stats, 0 plot without), %cat...
bd433c66413b3e0e780d63ba23a0f8153da28d50d24043f582376d51a5053921
MATLAB
3,880
92
% Combined Data reading from mvx neural file and aftifact removal % The neural data are read one channel at a time in increments of N samples %########## Reading the Individual Neural Channels mvx file N = 100000; %number of sample points to load or read artf_thr = 30000; % artifact threshold ********NEGATIVE or ...
40d4d030a935361ee87185d108c39c4b5bbcd89f5ba453df2534aa9e7b22d86c
MATLAB
3,881
118
%% This file shows how to use 'saveastiff' function. clearvars; [~,~,Z] = peaks(100); Z = single(Z); Z_index = uint8((Z - min(Z(:))) * (255 / (max(Z(:)) - min(Z(:))))); Z_color = uint8(ind2rgb(Z_index, hsv(256)*256)); Z_alpha = Z_color; Z_alpha(:,:,4) = repmat(0:1/100:1-1/100, 100, 1)*255; Z_color_multiframe =...
0d02c130d7b9766ae2cc8353faf09fdc898ea6c217f2eb4a0ed018524583cd95
MATLAB
3,882
107
% Simulate the network model with varieties of parameters to compute the % mutual information and linear Fisher information % Note: This code needs to be ran on a high performance cluster!! % Wen-Hao Zhang % Feb 20, 2020 % University of Pittsburgh setWorkPath; addpath(fullfile(Path_RootDir, 'linearHawkesProcess')); ...
ae5c64840c869c1ab9bb281f936977e457ccdbd726ab06d266ac21fe378061af
MATLAB
3,882
99
function metadata = createMinimalOMEXMLMetadata(I, varargin) % CREATEMINIMALOMEXMLMETADATA Create an OME-XML metadata object from an input matrix % % createMinimalOMEXMLMetadata(I) creates an OME-XML metadata object from % an input 5-D array. Minimal metadata information is stored such as the % pixels dimensio...
61eeb352e7f535f7a9175c9950b193cbe9f440f48c04ad3fa74912f250bccb25
MATLAB
3,883
67
%% Normalise individual structural scans and electric field magnitude images produced by ROAST % (c) Carys Evans, UCL % carys.evans@ucl.ac.uk % October 2019 %This script requires SPM12 %To run this script, make sure you have run your current flow models %through ROAST. This script converts structural MRI and ...
910fe837e0376dfb330c645867e76040d2dc6f8441a49e945381acb13a5a2cd3
MATLAB
3,884
94
function check_event_timing(study_info) all_obs_base=[]; all_obs_reach=[]; all_obs_grasp=[]; all_exe_base=[]; all_exe_reach=[]; all_exe_grasp=[]; for s_idx=1:size(study_info.participant_info,1) % Get subject ID from study info subject=study_info.participant_info.participant_id{s_idx}; % Where or...
c27f5f991b103df9f5e187d7ba92e00a1273dd1a5c6fe51dd3fabe8247fe6fc4
MATLAB
3,884
96
function outSignal = IPEMGenerateBandPassedNoise(varargin) % Usage: % outSignal = ... % IPEMGenerateBandPassedNoise(inPassBands,inDuration,inSampleFreq,... % indBLevel,inFFTWidth) % % Description: % Generates a band passed noise signal using inverse FFT. % % Input argume...
f362355e7dd04e261798c53b36c96ee0c5f30a0411843eab897d17fa540c1d3c
MATLAB
3,888
125
function [fNum] = plotRasters2(fNum,dataFile,functionFile,dataTraceFolder) load(dataFile,'emp') spikes = emp.rast; fs = emp.fs1; load(functionFile,'convVI','p') I = convVI(emp.I); nTrials_per_stim = size(spikes,2); nTrials_tot = numel(spikes); nStim = size(spikes,1); tt = (1:size(I,2))./fs; for i = 1:nTri...
996f088572ea9bdc1a3527cf60f179a41e6c661d59789e0a914ee0b3d2fd91a3
MATLAB
3,890
132
function [table_motion,table_still,motion_2]=get_table_motion_updated(speed_d,threshold_still,gap_for_motion,gap_for_still) % threshold_still=3; % gap_for_motion=1; %in seconds speed_d(speed_d<threshold_still)=0; T=length(speed_d)+1; motion=ones(1,T); motion(speed_d==0)=0; d_motion=diff(motion); motion_start=zeros(1,...
677eb08aa0a5f5a91a2119841d1d6413adf3f3524c8931e9e5d358bf94d3b532
MATLAB
3,891
121
function plt = create_confusion_matrix(counting_matrix, varargin) % create_confusion_matrix Create a confusion matrix using imagesc % X-axis is predicted value % Y-axis is true value % % INPUTS: % counting_matrix: (n x m) 2D matrix; Each row reflects the predicted % guesses for that ...
68046fd8ba10170e15baa73a1f2e4044cc6e63e169e9d4840d3bb277a7cd85ff
MATLAB
3,892
91
datapath = '/projectnb2/npbssmic/ns/PSOCT-qBRM_fiber_struct/sample03/'; P2path = '/projectnb2/npbssmic/ns/PSOCT-qBRM_fiber_struct/sample03_2P/'; % 2P file path reconpath=strcat(datapath,'dist_corrected/'); % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/M...
ac353f0effcf114319a6cc24873918a80876f17855b412d19654de3dc18f85ad
MATLAB
3,892
154
function f = localregression(x,y,x0,degree,kernel,h,mode) % function f = localregression(x,y,x0,degree,kernel,h,mode) % % <x>,<y> are vectors with the data % <x0> is a vector with the points to evaluate at % <degree> (optional) is non-negative integer. default: 1. % <kernel> (optional) is 'epan'. default: 'epan'. % ...
7fb2483fea9f11df0f15d56296857299666e313fcc4d3cf25cea7a71452cdb77
MATLAB
3,894
124
function [f_orco] = calcKNN_Habituation_PermutationTest(f_orco,states) % calcKNN_Habituation_PermutationTest performs a permutation test to % compare KNN distributions across time. Each state instance retains it's % f/df location, but the time since first entry is shuffled. The KNN % space is then calculated bas...
de0f268aa5ea9dbcf56067dd3d13f69fe8dfbcaf864613091e65ee0cdd569a96
MATLAB
3,894
97
function [link_cc, varargout] = fun_skeleton_get_link_cc(voxel_list, voxel_neighbor_idx_list, l_link_start_voxel_idx, voxel_unvisited_Q) % fun_skeleton_get_link_cc is a subfunction of fun_skeleton_to_graph, which % finds the link connected components. Except for the beginning voxels, % each voxels in the link has exact...
ee38307049b64fa4469e34b71c73f7ff333b36e4c18a1a1b6b736d7dcf48f7da
MATLAB
3,894
85
datapath='/projectnb2/npbssmic/ns/myelin_content_scattering_correlation_paper_data/somatosensory/'; % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/np...
23ac0b00f67f1e34794ae15712a3f79bd88bdc60cf13c98479bdbe7e296c3e68
MATLAB
3,897
133
function [nodes, edges, validatedNodes,validatedEdges] = regraphNodes_new(nodes, edges,validatedNodes,ds_rate) % Re-graph nodePos = nodes; nodeEdges = edges; nNodes = size(nodePos,1); nEdges = size(nodeEdges,1); if ~exist('nodeDiam') nodeDiam = zeros(nNodes,1); end hxy = ds_rate; hz = ds_rate; nNodesUnique = ...
f5d7758d9d24f65dcf5cf90e1790216699fd675813195a1e0d122b0a8b9b2330
MATLAB
3,897
76
function [input_graph, undeleted_info]= fun_graph_delete_dim_short_link(input_graph, link_label_to_remove) % fun_graph_delete_dim_short_link removes the links specified by the link % label. If delecting the link result in creating a endpoint, this link % will be skipped. %% Remove th_hair_length = 0; num_link_t...
38d1bfc642e00ecd008943152a11440a78182d9e1759c21aa15c70027545ae97
MATLAB
3,903
129
function y = Gtomo_nufft_filter_3D_par(omega, ob, do_phase) %function y = Gtomo_nufft_filter_3D_par(omega, ob, do_phase) % build the sinogram-spectrum-sized matrix % that is .* multiplied after 3D FT, before iFFT or NUiFFT % in % omega [M 3] frequency sample locations (radians) % out % y [M 3] filter % Based on Gtomo_...
21f98c042ef9e277afd01649c70d5ac0e83e998c04e6918c99c453af844434b7
MATLAB
3,905
103
function singleSessionRasterplots(data_dir,session_name, trackLength, plotWidth, plotHeight, preDrugTrials) % plots rasters for all cells in 1 session given data directory and name of % mat file that has neuropixel data synched with unity information % Requires Access ot the serer % Inputs: % data_dir = '/Volumes/gro...
b07d34bd4a20867792fda27e776841fdec64df808f825ff9ccb40deda03aa5c1
MATLAB
3,906
101
function stimfeedback_tSC(mainPath, animal, session, ch) %TSC_RATIO_OSCSTATE calculates the ratio of different theta cycles during %stimulation and control periods. % stimfeedback_tSC(MAINPATH, ANIMAL, SESSION, CH, ISSTIM, EXP) detects % oscillation states in the hippocampal LFP (long and short theta epocs, % ...
32f650a64e36a02e88e4966d02fb0eb12695fd55714aedd85961f5f9fff3eb0a
MATLAB
3,907
119
% sense_homodyne_recon_demo.m % demos use of sense_homodyne_recon.m, which combines % SENSE and partial Fourier reconstruction. Input image can be rectangular, % but both dimensions should be even % % resulting figure shows the improvement from demodulating with the % reference image and compares MSE to reconstruction ...
8f887cb245b1b65d459142a411b2dcb4f51cfe0098a9dfc96ee65989f37efebd
MATLAB
3,908
157
function [toDelete]=checkCells(fluoTraces,baseline,data, params) %v = ver; %parOn=any(strcmp('Parallel Computing Toolbox', {v.Name})); parOn=0; %parOn=1; %UNCOMMENT THIS FOR PARALLELIZATION if parOn numCores=feature('numcores'); isOpen = matlabpool('size') > 0; if ~isOpen matlabpool('open','l...
f947838022ca1509a2f81cc7edcb7123f97c39ed69f769b3edbde7a903f1ad40
MATLAB
3,911
81
function connect_link_str = fun_graph_shortest_path_through_3pts(metric, ep1_sub, mid_sub, ep2_sub, connectivity) % fun_graph_shortest_path_between_points finds the shortest path between % two point, with distance measured by the metric array % Input: % metric: 3D numerical array, specify the distance between n...
7ab780edd98563dc3e244f8a81e04a377fea6c7fe6081a9f7477b5dd529175a5
MATLAB
3,913
161
function [Af, Aa, dif] = test_adjoint(A, varargin) %function [Af, Aa, dif] = test_adjoint(A, varargin) %| %| test that the adjoint of a 'matrix object' A really is its transpose %| %| in %| A Fatrix or fatrix2 typically %| %| option %| 'tolre' dbl tolerance (relative) for equality (default: 0) %| 'big' 0|1 for big ob...
dc21e3ad096ea5a1e18516683cef6c1a03fb44c0e495418bf65ce2a68fefd03b
MATLAB
3,914
104
function [I_signals, full_timeline, timeline_signal_id, timeline_signal_id_movie] = make_experiment(images) params = model_parameters(); num_images = length(images); % Make image signals -------------------------- if isfield(params, 'learn_order') learn_order = params.learn_order; else...
2941eda5983330426fda1b27c241d0c79578bf20b0d6d55944ec55ca6be954bb
MATLAB
3,921
121
function recon_im = SENSE_recon(smap, reduced_fft, reduced_dim, np, regularizer, mask, figs_on) % function recon_im = SENSE_recon(smap, reduced_fft, reduced_dim, np, % regularizer, figs_on) % in: % smap [N M nc] complex sensitivity maps % reduced_fft [N/np M] or [N M/np] undersamp...
f7768e25e850ebb0cd4fb3609fa68f60592d10601fd765f89763e791aa32fde8
MATLAB
3,921
143
clearvars -except MCmean0 %input image variables prompt = {'Pixel width (microns):','Day:','Position:','Enhancement factor:','Image length:','Dilation factor:'}; dlgtitle = 'Input'; dims = [1 35]; definput = {'0.3405','1','1','20','500','1'}; answer = inputdlg(prompt,dlgtitle,dims,definput); D=str2double(answe...
ba6b1e40034368d193a581a11857d48542f03cbd74c396ff5e3468f92c6f266e
MATLAB
3,928
117
function pointsI = circOpposingPoints(pointsI, startI, endI, vLength, ... varargin) %CIRCOPPOSINGPOINTS Find the equivalent point indices on the opposing side % of a circular vector. % % POINTSI = CIRCOPPOSINGPOINTS(POINTSI, STARTI, ENDI, VSIZE) % % POINTSI = CIRCOPPOSINGPOINTS(POINTSI, STARTI, ENDI, VSIZE, %...
fec961484902bc54869a9700cbcca316390a5259c78973772c352c2b27fe7e45
MATLAB
3,928
139
function xs = de_pl_osps(x, Gb, ymi, Im, rmi, R, ftab, Gtab, masseff, niter, pixmax, gi, denom) %function xs = de_pl_osps(x, Gb, ymi, Im, rmi, R, ftab, Gtab, masseff, niter, pixmax, gi, denom) % The Dual-Energy PL-OS-SPS algorithm for transmission Poisson problem % (ordered subsets, separable paraboloidal surrogates) ...
b7a87a624daa7118a6c960ff17fc89b26b9c2ff1f76b5b10e0c3d4e81970551f
MATLAB
3,930
113
function plot_replay_events(significant_replay_events,place_fields_BAYESIAN,events,track) load significant_replay_events_wcorr.mat load extracted_place_fields_BAYESIAN.mat load extracted_position.mat load('X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\extracted_replay_plotting_inf...
680efc842854f69c673073db0f3c833a459ae6e26d2a553742be1ad2039015b7
MATLAB
3,931
153
function xs = tpl_os_sps(x, Gb, yi, bi, ri, R, niter, pixmax, curv, ... gi, denom, relax0, chat) %function xs = tpl_os_sps(x, Gb, yi, bi, ri, R, niter, pixmax, curv, ... % gi, denom, relax0, chat) % % T-PL-OS-SPS algorithm for transmission Poisson problem % (ordered subsets separable paraboloidal surrogates) % in %...
8a52f9f90cd6764e7568e6388ba2a28dd7bc201e4695cddf2dfc70225471d844
MATLAB
3,932
83
folder='/projectnb2/npbssmic/ns/210310_PSOCT_4x4x2cm_BA44_45_milestone/'; datapath=strcat(folder,'dist_corrected/'); % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addp...
c16eedc27061818ea27ce498637b2bcb6e19e0f6db763abe724c9f3e2ae38d87
MATLAB
3,937
112
function [fNum,stateFigure,kinFigure] = plotStatTestRetContKNN(f_orcoAll,state2Cons,tim2Cons,p_cutoff,fNum) if isempty(p_cutoff) p_cutoff = nan; end k=1; nGen_per_page = 3; nGen = size(f_orcoAll,2); for gen = 1:nGen m_1 = f_orcoAll{1,gen}.model.params; m_2 = f_orcoAll{2,gen}.model.params; tGrid = f_or...
a0c78aa7f1eda7f3972e61ac0d39e367ceb807b4514c26a91ba102ffe7782035
MATLAB
3,941
120
function [outZCR,outZCRFreq] = IPEMCalcZeroCrossingRate (varargin) % Usage: % [outZCR,outZCRFreq] = % IPEMCalcZeroCrossingRate(inSignal,inSignalFreq, % inFrameWidth,inFrameInterval, % inZeroTolerance,inPlotFlag) % % Description: % Calculates the...
90c58a290059e12de7b0ea12fb23db32d8c345e07b54a6ad42431d31d8835b71
MATLAB
3,942
102
function [newStateProb,XX,YY,newState,newStateProbBaseline] = getKNNProbStop(f_orco, s, keyNdx, xGrid, yGrid, ... ratio, Thresh, K, state, genotype, plotFig) l = cellfun(@(c)strcmp(c,keyNdx),{state},'UniformOutput',false); l2 = cellfun(@(c)strcmp(c,keyNdx),{'1'},'UniformOutput',false); l3 = cellfun(@(c)strcm...
9eab3722e1cf27bed220859f44033a83af69f26d282a5cc27ffc303927d8ace7
MATLAB
3,944
166
function xs = epl_inc(x, Gb, yi, ci, ri, R, varargin) %function xs = epl_inc(x, Gb, yi, ci, ri, R, [options]) % Incremental optimization transfer version of EM algorithm for % penalized log-likelihood emission image reconstruction from Poisson data. % see eql_sps_os.m for arguments % % options % niter (#) # of iterat...
0d2a268b1b40e875f7e16ebeafc75ba332bfa4c50cd39bce2d62342f88edb7fa
MATLAB
3,945
98
% Title: Generation of Parameters for CEST Pools % Description: This function is responsible for generating the parameters of % CEST pools. It initiates the parameters for a set number of pools, % and then, based on user-defined limits and ranges, it populates the % parameters needed for each pool such as relaxation ...
d842d2cf9aa796fda6088f599f056e89b4c1414a6bca84d3f5af5bcfcefb7f1d
MATLAB
3,946
167
function ob = Gdsft(om, Nd, varargin) %function ob = Gdsft(om, Nd, varargin) %| Construct Gdsft object, which computes (nonuniform) FT samples %| of signals with dimensions [(Nd)] exactly, e.g., for testing Gnufft %| For faster computation, use Gnufft instead. %| See Gdsft_test.m for example usage. %| %| in %| om [M D...
12c13f994c9803561fc1f3c6889e975550af6a831fff83931421ff2a0d4b3013
MATLAB
3,949
164
%MTIT creates a major title in a figure with many axes % % MTIT % - creates a major title above all % axes in a figure % - preserves the stack order of % the axis handles % %SYNTAX %------------------------------------------------------------------------------- % P = MTIT(TXT,[OPT1,...,OPTn]) % P...
8cff306f737feaa13614025ad75786af1c5131c8701a389225c4684d6d481572
MATLAB
3,951
124
basepath = pwd; %set format format long % THIRDPARTY DEPENDENCIES addpath(fullfile(basepath,'thirdparty')) addpath(fullfile(basepath,'thirdparty','QPBO-v1.32.src')) addpath(fullfile(basepath,'thirdparty','glmnet_matlab')) addpath(fullfile(basepath,'thirdparty','glmnet_matlab','glmnet_matlab')) addpath(fullfile(basepa...
b55bc6c5a3c54f9d814628fa48f0f3996dc29d619e312dddac72aea776087870
MATLAB
3,952
118
function [ncs_out] = fn_read_neuralynx_ncs_split(fname) %% Read neuralynx .ncs file using Fieldtrip read_neuralynx_ncs % Based on ft_read_neuralynx_interp from Martink Vinck and Fieldtrip error('dont use this, use fn_read_neuralynx_interp'); if exist('/home/knight/','dir');root_dir='/home/knight/hoycw/';app_dir=[root_d...
e801d4ce9ad438ab8c7cad069bb6f56b741282a17305223e695a060ac48b9901
MATLAB
3,952
164
function [sig_tps,p,tbl] = shuffled_permutation_test_Fscore(mean_coherences, lags, thres, repetitions, anova_samples, plt,nS) % loop through time points and calculate F-scores for original collect % labelling Fscore_org = zeros(lags+1,3); labels = {'Fscore resampled frequency','Fscore resampled trial length', 'Fscore...
350e2829576215a2ddf38bffcc9b21ad6022edeb54a8baa8b5c83728ba283bf9
MATLAB
3,953
92
function [linker, paired_ep_ind, found_idx_str] = fun_graph_get_linker_for_int_link(vessel_image, vessel_mask, vessel_skl, int_link) % fun_graph_get_linker_for_int_link use threshold relaxation to find the % linkers for internal link with endpoints. % Input: % vessel_image: 3D numerical array, image stack % ...
236b995ed574e6623be9c17737eebcfff54ec5c2e4ac11daed8bf00fa85f1583
MATLAB
3,956
114
function compare_retina_locations() %UNTITLED Summary of this function goes here % Detailed explanation goes here dataset_path = get_dataset_path(); imgs_path = [ dataset_path '\17. REAVER Data\Exp_300 C57Bl6 Lectin@647 Retina\zsnap']; img_items = dir([imgs_path '/*.tif']); metric_tbl = table(); elem = @(x) x{1}; ...
3d5fc97d90b1bd6f41795e7fcb110953bc2284ac81b970a0427201f95e0d6021
MATLAB
3,959
148
function [D]=pons_cut_adf(subject, th_pval) % For the subject "subject": computes the Dice coefficient D=2*Nab/(Na+Nb) % Na is the volume of the Cerebellum+Brain-stem obtrained trough the volume-based labeling % Nb is the volume "filled" obtained from the surface-based stream % Nab is the volume of th...
cf9ded33a4b3adc10fa680090653cd03631b7e0b1553b57de08d8fda66e324c3
MATLAB
3,961
139
function proj = ellipsoid_proj(cg, params, varargin) %|function proj = ellipsoid_proj(cg, params, varargin) %| %| Compute set of 2d line-integral projection views of ellipsoid(s). %| Works for both parallel-beam and cone-beam geometry. %| %| in %| cg ct_geom() %| params [ne 9] ellipsoid parameters: %| [x_center ...
f66df2b2daac1cc364b87c470efc6aa336dcef05e3a3f2a629112a031e53fdb5
MATLAB
3,962
95
% % plot raster and PSTH, grouped by multiple conditions indicated by % different colors. Pulls together various code needed to do this with one % simple call. % % % urut/Oct'22 function [axRaster,axPSTH]=plotSpikeRaster_multiple_simplified( plotMode, offsets, limitRange_forRaster, limitRange_forPSTH, markerPos...
9235f42845d3f02d01f7f8f68408c41b49ab69d85aececb54c6b2433706c86d0
MATLAB
3,964
122
function [design,col_names,col_values] = fn_build_design_predictors_numeric(SBJ,stat_id) error('check for 2021 updates'); %% Build design matrix of predictors for regression analysis [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; %% Variable Handline eval(['run ' root_dir 'PRJ_Error/scripts/...
272ee9299bfa72bd2daa10936b79c9f150be1e2e2e3dafb64741944b5d863428
MATLAB
3,968
110
%% function [deltaB,mag,output_chi] = addChiSource(chi_mo,maskErode,Params,n_time,th,filter_flag) % [deltaB,mag,output_chi] = addChiSource(chi_mo,Mag,maskErode,Params,n_time,th,filter_flag) % Author: Joe % Affiliation: XMU % Create: 2022-12 % Updated Joe: 2023-11 if nargin<5 n_time = 100; % the numeber t...
d69b69bdbb7ba0c7f87c89aca38b017129a0133b5f98a6f5576cfa8b811759e0
MATLAB
3,969
136
clear all subj = '39' regList = { 'OFC' 'FRO' 'TEMP' 'MTL'} if strcmp( '83', subj) regList = { 'FRO' 'TEMP' } end %% % go to dir/load data cd('/mnt/yassamri/iEEG/sandra/groupdata_spectrograms_onset') load(['subj' subj 'spectrograms.mat']) addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final/fieldtrip-...
1f4a3c2002e7c4cca8d2cb5322c4292f9f78513025556bb8b5b3f679191e458b
MATLAB
3,970
85
function add_nans_to_data(subjects,task) %ADD_NANS_TO_DATA For the subject that are missing data for certain %conditions, add NaNs so that their data still has 60 conditions. % %Input: subject IDs, task (1=categorization,2=distraction), conditions to %replace % %Returns a data matrix of 60 conditions x dimensions of th...
b3e45997180d131fb3ef44150e3f3ef5187c66b18e83ed110ec34d58eda2c658
MATLAB
3,971
81
% specify dataset directory OCTpath = '/projectnb2/npbssmic/ns/remote_folder/'; % OCT data path. datapath=strcat(OCTpath,'dist_corrected/'); P2path = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_20T/NC_6839_2P/'; % 2P file path % add subfunctions for the script. Change directory if not running on BU SCC addpath('/p...
f97b42ed9e7cc1a1cfd02cc5562c9535d0ccec14e11602103804f80cd18e4b4e
MATLAB
3,972
99
% Define figure coordinates and axes figX.fig = figure('Name', 'Figure X: STAs Across Frequencies'); set(figX.fig, 'Units', 'pixels', 'Position', OSScreenSize([15 4]), 'NumberTitle', 'off'); figX.pta(1) = axes('Position', [.025 .08 .225 .8]); figX.pta(2) = axes('Position', [.275 .08 .225 .8]); figX.pta(3) = axes('Posit...
a6e719d2dd7a28a70f6da8dda0ea34ceed4ecda6e2817fedd562fe1441739059
MATLAB
3,977
149
function plotOneEx(tbl) thr = 0.8; nCh = size(tbl,1); switch nCh case 1 nrow = 1; ncol = 1; case 24 nrow = 6+1; ncol = 4; ha_ch = gobjects(4,6); case 32 nrow = 8+1; ncol = 4; ha_ch = gobjects(4,8); otherwise end lcolor = lines(2); lineW...
acb9ed08f83a5e415d1b7fb5cdbbb704748db231f3e968cb09ad7cb57957bd55
MATLAB
3,979
115
clear all;close all;clc figure hold on addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final') % define params group_plots = 'yes' freq_range = 'deltatheta'; fpass = [4 5]; times1 = {'0' '0' '0.5'};%'0' '0' '0.5' times2 = {'2' '1' '1.5'};%'2' '1' '1.5' bidirec = 0.5; pattern = 1 phase_l...