sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
40ff1955fc6a3b7ea72d2485e1a6ae62bbdbcaa414a77aac662cb7587561041b
MATLAB
3,980
95
%EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, dest, crop, append, gray, quality) % % This function converts an eps file to pdf f...
082e5a7cadb167dd7aad561c68828debcc0887963a29be6ba22e674e5be4629e
MATLAB
3,981
111
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Dependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % GenericEEG.cnt: irrelevant data to strucutre EEGLAB properly % Channel_Locations.xyz: locations of EEG channels %%%%%%%%%...
56f3486926362200236ae999839f58a3b444cc88292288b1013c77fc3f07046f
MATLAB
3,982
101
clear all; close all;clc subj_list = {'39' '44' '57' '63' '66' '84' '85' '87'};% addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final') group_roi_mni = cell(1,8) i=0 roi_name = 'OFC_FRO_TEMP_CING_INS_EC'%'OFC_FRO_TEMP_CING_INS_EC' %'OFC_FRO_TEMP' for iSubj = 1:length(subj_list) subj=subj_list{iSubj}; ...
f70457e5ff049c85a95bd8594f48a87eef3a85b38c89edffa07a252b1ab9cf79
MATLAB
3,982
111
function [cp, p] = cross_validate(data, labels, varargin) % cross_validate Perform cross-validated decoding using model of your % choice. % % INPUTS: % data: 2D double; [nImages x (xPixels*yPixels)]; % training data % labels: (1 x nTrials) do...
6539ad36dbd8dd3d9d2944393c289045809391b79925fe9b8a65522b8cbe9f57
MATLAB
3,985
75
load('RevisionResults.mat'); subjectColors = [rgb(106, 27, 154); rgb(239, 108, 0); rgb(46, 125, 50)]; fig5.fig = figure('Name', 'Figure X: Correlation Within Arrays'); set(fig5.fig, 'Units', 'centimeters', 'Position', [40 20 8.8 4.6], 'NumberTitle', 'off'); fig5.panelA1 = axes('Position', [.08 .175 .25 .775]); annota...
deae67e451a2df651c603a7423e270f5c4cc67f6ece1b9d94bc3e9d0d6fc791b
MATLAB
3,987
101
function myParadigmSetup % This function sets all basic parameters of the SOFTWARE in your setup. % This function needs to be stored on each experimental computer. All % required paradigm definitions are stored in the global variable SETUP % created by this function. Edit this function when building a new setup. % Desc...
1f9327555933b2f7f400ef6e4f0046dfe8c7c9979dbebf260647dd831d1a3d7f
MATLAB
3,990
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 ex...
f41ecfc8296fa987c3499e6d14a6a44016f38b84b064b90517e0807b2e43a09a
MATLAB
3,990
103
function plotRows=PlotROIResponses(numCell,traces,onsets,offsets,responses,responsesStd,mapData,im,cellper,roiHSVRescaled,prevFrame,eventDuration,params,plotRows) mapParams=nan(length(mapData),1); mapFrames=cell(length(mapData),1); mapLabels=cell(length(mapData),1); numStim=length(mapData); for i=1:numStim mapPara...
71114060a0b157ddff519408a44bb125cbb9f8329f6f5cdeb64275fe6f2869d7
MATLAB
3,993
123
function [y,t,cache] = mTRFresample(x,fsin,fsout,window,buff,varargin) %MTRFRESAMPLE Resample uniform data by a non-integer factor via averaging. % Y = MTRFRESAMPLE(X,FSIN,FSOUT) resamples the uniformly-sampled signal X % from a sample rate of FSIN to FSOUT by averaging the nearest neighbours % every FSIN/FSOUT ...
e68855d1cc55d1c2b29d3c57ac8e66176532a217d9755e7e5a25fcd8fec74b40
MATLAB
3,993
77
function Figure_5D_plot % % Written by Ayaka Matsumoto, October 2023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Input: 'Fig_5D_SMBD_phase_data.mat' % Raw data for neck bending angles and the activity of SMBD % Related to...
46ccef14c2ead0f77e9245a988780d0e4d386a61c3ce3b0851d928feae76d6c4
MATLAB
3,995
184
% Oliver Hinds <ohinds@mit.edu> % 2007-11-28 function [ps as Ts] = accum_cor(vol, onoff) % hack to make scale same as dicom vol = vol.*49; hrf = spm_hrf(2); ntp = size(vol,4); imsiz = [size(vol,1) size(vol,2) size(vol,3)]; % build regressors if(size(onoff,1) < size(onoff,2)) onoff = onoff'; ...
faaa9952c45f9a6fd7ccb204dc4c044c8721c3c798e915852cad0cade623b16f
MATLAB
3,995
165
function [C, wjk] = C2sparse(type, kappa, nbrs, chat, dist_power) %function [C, wjk] = C2sparse(type, kappa, nbrs, chat, dist_power) % % create 2D penalty matrix C with 2nd-order pixel neighborhood % that performs 1st-order finite differences. % R = beta * C'*D(wjk)*C is the penalty Hessian (in quadratic case) % in: %...
b1ef19176675586c14dfe766641699b7381864d4fe192beab81c7f462fb8ebac
MATLAB
3,996
76
% Define figure coordinates and axes figX.fig = figure(''); set(figX.fig, 'Units', 'pixels', 'Position', OSScreenSize([12 10]), 'NumberTitle', 'off'); figX.modMC(1) = axes('Position', [.05 .535 .3 .415]); figX.modMC(2) = axes('Position', [.37 .535 .3 .415]); figX.modMC(3) = axes('Position', [.69 .535 .3 .415]); figX.m...
636bc8c68be40e503a9b83c4bbef828deb030a592ee402b47218b9826e1be99e
MATLAB
3,997
104
function rez = runTemplates(rez) % this function will run Kilosort2 initializing at some previously found % templates. These must be specified in rez.W, rez.U and rez.mu. The batch % number at which the new template run is started is by default 1 (modify it by changing rez.istart). % If you don't mind changes in tem...
39e88b0c90b761784820fc96d246eb60f1e9f959b40a1529b16282c24b66fa1a
MATLAB
3,998
126
clc;clear;close all root='..\'; addpath(genpath([root,'NeuralCorrelateEvidenceAcc'])) %% rootpath='..\dataset\Mice\result\total_clusterArea_paper_results_kernel_20_half_gaussian\'; rocPath=[rootpath,'_auroc\']; dpcaPath=[rootpath,'_clustering\_dpca\stim_dp_allUnits\']; load([rootpath,'areaInfo']); load([dpcaPath,'clus...
59392a86ea378623802a4e0d5702ad1a6947e8c36e6741e78e21c662dc96f29a
MATLAB
3,999
116
function output = setKernelData(input,location,range,value,kernel_type,width) % output = set_kernel_data(input,location,range,value,kernel_type,width) % Author: Joe % Affiliation: XMU % Create: 2022-12 % Updated Joe: 2023-11 if nargin<5 kernel_type = 'boll'; % uniform end if nargin<6 width = [4,4...
b58fff3ae9def09040ebcb75e52b8ed29e2e95a840f6c14bf6e758664a365660
MATLAB
3,999
126
function [u, Ps, ue] = spm_uc_clusterFDR(q,df,STAT,R,n,Z,XYZ,V2R,ui,G) % Cluster False Discovery critical extent threshold % FORMAT [u, Ps, ue] = spm_uc_clusterFDR(q,df,STAT,R,n,Z,XYZ,ui[,G]) % % q - prespecified upper bound on False Discovery Rate % df - [df{interest} df{residuals}] % STAT - statistical field ...
dae6f7c900f4f7fe876ee000fd8b31bb1cc59f177c135ad30b6cf4deb4162970
MATLAB
3,999
75
function plot_lap_thetaseq_shuffles(test) if test == 1 load('Theta\lap_theta_sequence_quantification.mat') load('Theta\lap_thetaseq_phase_shuffle.mat') load('Theta\lap_thetaSeq_PREspikeTrain_circ_shuffle.mat') load('Theta\lap_thetaseq_position_shuffle.mat') elseif test == 2 load('Theta\lap_theta_s...
127c717f117e194a88480c3c7c76cba66739326c2f235d74f9981bdfcc8e714b
MATLAB
4,001
132
clear cd D:\Exp_noInstruction\ resOut = [pwd '\results\']; outdir = [pwd, '\data\'] load([resOut,'Exp6_mulogRT'],'Exp6_mulogRT'); %% create datatable % templates conditionTemplate = categorical(repmat({'periodic','aperiodic','cue'}',1)); % preallocate resp = []; condition ...
29971667061a62512045a8cb745c1212a7ffc878c20242c8cbecfb207b06d610
MATLAB
4,001
94
% Demo code for Population decoding and multiple linear regression models used used in the study % Dynamics and maintenance of categorical responses in primary auditory cortex during task engagement % by Chillale et al., 2023. % Download the data from Zendo and run the following to reproduce the some % of the figure...
8680e66b96e4d64d6705f73fe25b714c21397cd3fb92a999f686c7f0f18c6614
MATLAB
4,001
146
function fig = plotTerminationZoneSize(obj,sequence,percentile,titleText) skipTables = true; if(~exist('sequence') | isempty(sequence)) sequence = obj.loadIterSequence(skipTables); end if(~exist('percentile')) percentile = 0.95; end if(numel(sequence) > 0 ... & sum(sequence(1).numPres...
2dbcdfcdb24ff3949a10c141146c5d472c01617ab2b0846c14d99d12c09a3cfd
MATLAB
4,002
143
function [Z,p1,U,p2] = b_rao(x) %RAO Rao's Spacing Test. % [Z,P1,U,P2] = RAO(X) calculates Rayleigh's Z-Statistic (Z) and Rao's % U-Statistic (U) with the corresponding p-values (P1 and P2). Input % argument X is the vector of phase angles in radians. % % See also WATSON and WATSONTWO. % Balazs Ha...
814bc86cfea350c3b796ccd9f7157ac2c8beec514ecd49ee1299294d1e769b80
MATLAB
4,002
142
function [uht,PP] = DynamicMetaplex(A,Mass,mesh, sink, source,u0) %DynamicMetaplex.m - Computes a diffusion process on the metaplex with %subjacent network A. It can be used with the outputs of function %DefaultSimplex.m % %INPUTS: % -A: Graph of the simplicial complex, where the edges and tri...
ffd0e6cc123329c347ece770226e38c167e13ee624a3dca5f3d42e42ca5e3915
MATLAB
4,002
123
function stimulus_reconstruction %STIMULUS_RECONSTRUCTION Stimulus reconstruction example. % STIMULUS_RECONSTRUCTION loads an example dataset and trains a neural % decoder that reconstructs stimulus features (speech envelope) from 2 % minutes of 128-channel EEG data as per Crosse et al. (2016). % % Example dat...
26e5a4fbfea6e61cafa093c8bcc185d279fb0db042bf155113bfadc38c7ccad0
MATLAB
4,004
111
function strOut = createGetRequestString(dataIDString,varargin) %CREATEGETREQUESTSTRING creates the XML string to get data from the % infoserver based on inputs. Required input is a dataIDString. If there % are no other arguments, it will just create a string to request whatever % is specified in the dataIDString. Subs...
2d97f817649baa3463c856805c1ab11be4b52737a5a15d4d87aa47dac997a6c1
MATLAB
4,004
110
function [lowbound,highbound,validpeaks,peakvals] = bounddetect_v2(cmap,stmstart,stmend) load('norms.mat','normsig') %Calculate dot product of raw voltammagrams with NE signal norm rho = zeros(1,size(cmap,2)); for i = 1:size(cmap,2) rho(i) = sum(cmap(:,i).*normsig); end rho(rho > prctile(rho,99.5)) = NaN; rho(rh...
6f4d6057c8f11c41b822f481b2c6d7d5c897dbbcbb7fdc37b3c02da11d8844b6
MATLAB
4,005
85
function [input_graph, new_link_info] = fun_graph_pruning_convert_node_to_endpoint(input_graph, node_label) % fun_graph_pruning_convert_node_to_endpoint convert a node of degree 1 to % an endpoint. If the node contains more than 1 voxel, select one of these % voxels that connected to the link. % Input: % input_grap...
260c5737f1c320bcbd90fc4441d299cd8453a7209cd04d9990a2719d82e3fb56
MATLAB
4,007
100
%% Plot Sup Figure 10b imaging and LFP traces %% Define Paths of Loading Files and Save Files currentFolder = mfilename('fullpath'); % determine the filepath based on where the script locates scriptFN = mfilename; filePath = erase(erase(currentFolder, scriptFN), strcat('scripts', filesep)); searchPath = strcat(filePat...
ce50d22ce83249c37e5c47944bf031a07ae52a5721cacdb5d5c5ea75e264200b
MATLAB
4,011
127
function [Ct, Cp, Ca, ht] = ir_mri_dce_aif1(ti, Ktrans, kep, varargin) %function [Ct, Cp, Ca, ht] = ir_mri_dce_aif1(ti, Ktrans, kep, varargin) %| %| Generate tissue contrast concentration curves according to Yang et al. %| "Multiple reference tissue..." MRM Dec. 07 (yang:07:mrt) %| %| in %| ti [Nt] [min] time sample...
d5d35046e150f31a006589da77ba74c3e20a341b29fc78aca8aed108d66bc04f
MATLAB
4,013
164
% Gcone_twv_test.m % test the Gcone object for "thread within view" version by Brian Gonzalez % Copyright 2015-07-20, Jeff Fessler, University of Michigan pn = jf_protected_names; systypes = 'sf2,v:all'; systypes = {'sf2', systypes} nsys = numel(systypes); f.is_zxy = true; if f.is_zxy to_zxy = @(x) permute(x, [3 1 ...
e886a617d2ac3bc51f72a64eba3a40b4206d5a5d4f9caf3388beb98027aab2c6
MATLAB
4,019
90
function bootstrap_scene_vs_cat_decoding_peak_difference(subjects,task) %BOOTSTRAP_DECODING_PEAK_DIFFERENCE Calculate the confidence intervals of the difference between peak %latencies of categorization and distraction decoding. % %Input: subject IDs, task (1 for categorization, 2 for distraction) % %Output: confidence...
24812aa7e816fd93ca23be165a24fdfdfe3007ea98663633b7f3196bc306eef0
MATLAB
4,021
106
function [net,YTest,YPred,ClassRes] = trainFeatures(dataTable,ClassName,ClassID,SynthVar) % dataTable is the input dataset for training. Default tables are tableOrig % & tableSynth. "ClassName" is the class type to train the model on. "ClassID" % defines the default IDs for each class. % Change labels to model ...
eb0d4af82a453f14bad1b63f80a67de458865b899910f3b3bb7e4523563108f1
MATLAB
4,026
79
% This is the main script for performing the GPR reconstruction pipeline. % The method is described in details on the manuscript. % We have also provided a tutorial script which should help in % understanding the basic functioning of the reconstruction procedure % (See part 3 of the tutorial_gprML.m). % The analysi...
b6192fb4ea954c9ce7ca94434f5c57303a46d100eff6b68d0c22faecd83b733e
MATLAB
4,028
115
function analysis_01_lagged_coherence(study_info, varargin) % Computes lagged coherence across a range of frequencies and lags % Parse optional arguments defaults=struct(); params=struct(varargin{:}); for f=fieldnames(defaults)', if ~isfield(params, f{1}) params.(f{1})=defaults.(f{1}); end end pipelin...
2e73829d8c5faed98dd54ddcb50133311e54296892b86ca01eb042b7ac1dcc49
MATLAB
4,029
148
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...
569d321479951a3cda48f4b412efac669b2f4f32917b87774b168fbc26d5c1e9
MATLAB
4,029
95
function [labels, names, colors, line_styles, markers] = fn_puns_category_label_styles(cat_id) %% Converts the name of a category ID into category labels, plotting colors/styles % Assumes model_id = 'EpnRPEs_DifFB' ~ EV + pRPE + nRPE % RL Features: expected value (logistic regression), positive RPE, negative RP...
81e7d7fb73ab417e164a553c43b6e9e2a9e5a21d65e14fda560c537292323a35
MATLAB
4,029
111
function [taskEvents, taskEventType, taskLabels] = getTaskVariabels(D, varargin) % Written by J. Yates, 2021 % Modified for sharing by Bharath Talluri, Dec 2022 % Get Task Variables will set up the task events for processing by the % design matrix % Inputs: % D <struct>: The data struct (see io.preprocess_data) % ...
169671697e8f73937c1eaeb78eae4e3eb18ad8d1019de5571b0605502f62e749
MATLAB
4,031
128
function Prepare_TestData_HR_LR() clear all; close all; clc path_original = './OriginalTestData'; % dataset = {'Set5', 'Set14', 'B100', 'Urban100', 'Manga109'}; dataset = {'Custom'}; % dataset = {'DIV2K', 'Flickr2K'}; %dataset = {'720P', '1080P', '4K'}; ext = {'*.jpg', '*.png', '*.bmp', '*.tif'}; degradation = 'BI'...
5ad8e0e94ea66d872841fdff7faa28ae6403630f20f7f9f0924997d7468d5a56
MATLAB
4,031
89
function [local_models] = getAllLocalModel(model_collection,coords,ifsave,savename) savepath = '/vega/brain/users/sh3276/results/luis/fig/m21_sample_d2_d3_local_models/'; model_structs = cellfun(@(x) struct(... 's_lambda',find(model_collection.s_lambda_sequence==x.s_lambda),... 'p_lambda',find(model_collectio...
9ad44723a64e7072abde1b0d535311a23df3cd6b6ad54e4fb3d4452c125fdba0
MATLAB
4,031
150
function [Dice,pval]=wm_seg_adf(subject, th_pval) % For the subject "subject": computes the Dice coefficient D=2Nab/Na+Nb % where: % Na is the volume of the WM obtrained trough the volume-based labeling % Nb is the volume of the WM segmented in the surface-based stream % Nab is the volume of the overlap % Uses...
5913afc49e229fdca308f435152c11636de93e37957faba8fbb485a26eb12795
MATLAB
4,033
100
function outResult = IPEMWriteSoundFile (varargin) % Usage: % outResult = IPEMWriteSoundFile(inSignal,inSampleFreq,inFileName,... % inFilePath,inSection) % % Description: % Writes (part of) a sound signal to file. % % Input arguments: % inSignal = sound signal (each row r...
8d4df5b5b83d4d1579bbd60de904bee970dbd527e6289a4998fdb04f93f3ff9b
MATLAB
4,033
129
function [w0, phi] = adw_fan_new(sg, ig, wi) %function [w0, phi] = adw_fan_new(sg, ig, wi) % % Compute the angular-dependent weighting for fan-beam geometry. % w0(\Phi) = w(x0, y0, \Phi) % For fully corrected penalty: % w(s',\beta') * J(s') | \phi'=\Phi + ... % w(s',\beta') * J(s') | \phi'=\Phi-pi % See fessler chapte...
2714d2112d539965fff5b19935237990f34155647b1e00958930131f9eec8427
MATLAB
4,039
93
function [outSignalSegments,outSampleFreq] = IPEMSnipSoundFile (varargin) % Usage: % [outSignalSegments,outSampleFreq] = ... % IPEMSnipSoundFile(inFileName,inFilePath,inTimeSegments,... % inWriteSegments,inOutputPath) % % Description: % Snips the sound file into segments. % % Inpu...
887930f5e3bc441887bc7427a831acde7fae0caa2de37f4bc7a9edce6d9f90bb
MATLAB
4,039
144
function create_number_awake_replay_figure % NUMBER OF AWAKE REPLAY EVENTS TRACK AND PROTOCOL cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\figures\Awake replay on track' events = openfig('Norm Number of awake replay events per track__ALL_Protocol.fig'); % output figure cd 'X:...
087d739be4ec8a4f9ef710de1e8351d225dfcbff865c166d5c1da19e4750d371
MATLAB
4,041
139
function [Acc, Y_hat, Score, Gini] = RandomForest_HRV_validation(data1, data2, data3, Y_tst) % This function performs a Random Forest validation classification. This % function uses Random Forest console as implemented in: % https://code.google.com/archive/p/randomforest-matlab/ % % Inputs: % data1 data2: struct with t...
81f556d143538765a93d0268266d37238862fdf27d74303111bd4ad8b83cc981
MATLAB
4,041
79
classdef ieegStructMicro < ieegStructClass % The ieegStructMicro is a subclass of ieegStructClass specialized for micro-scale iEEG data. % It extends the functionality of ieegStructClass by adding additional methods for spatial smoothing % and spatial averaging specific to micro-scale data. propert...
6b95aad043ce301299c6605300b75b8119a559fc4aeafef22607b0a41b31f096
MATLAB
4,042
132
function [odata, sing, Vr] = ir_mri_coil_compress(idata, varargin) %| MRI coil compression via PCA %function [odata, sing, Vr] = ir_mri_coil_compress(idata, varargin) %| %| Given data (idata) from multiple MRI surface coils, use SVD/PCA %| to find data (odata) for a smaller number of virtual coils. %| %| todo: current...
82e23e9f22f6f2ece14b046e8eec812841d28a2826106f2af92478840d0261e3
MATLAB
4,049
123
function comparison_method_to_groundtruth(xlsx_path,gt_xlsx_path) % Compare output from a single method to groundtruth, used to examine data % before and after curation. % Detailed explanation goes here % Gt xlsx auto_tbl = readtable(gt_xlsx_path); auto_tbl.Vessel_Length_Density = auto_tbl.Vessel_Length .* ... ...
3eff88c6695b015896afc4b335aaf25eb51a5a85c9b0da7e98022064d3230793
MATLAB
4,057
99
function dch = calcDecoherenceBandForSessions(fltrCells,dchFolderPath,paramsPath) %filter for WT mec cells by session seshes = unique(cellfun(@num2str,fltrCells.metadata(:,1),'uni',0)); numSesh = numel(seshes); % load params tabel params = readtable(paramsPath); ds_factor = params.ds_factor; %filter for WT mec cells...
a105c0217f811c453cc96c795ae9f764c0a555d297722e563ca968cfdd7c77bd
MATLAB
4,057
103
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(TABLE), VIOLINPLOT(STRUCT), VIOLINPLOT(DATASET) % p...
45b15e7951167851d4721a4fc561ab0fddc4b484bc5035a6820c6e8e7705fa39
MATLAB
4,060
86
%% Coding an MRI experiment % In an MRI experiment the scanner sends a trigger for every volume, and % the experiment has to know how many have arrived and when. The OTBR % Toolbox does not read these triggers itself. A separate program, the % trigger counter, counts them and writes the count and the time of the % last...
917b90e02d2d9f5a26a267f50fe7f836263bfa47eb8c493b44949e3cf868ddd6
MATLAB
4,061
99
function [Data] = GetPopData(RootName,Animal,binsize,Sess) Cat = [4,8,12,16,20,24]; if strcmp(Animal,'Timanoix') load([RootName 'SessionInfo_RecSess.mat']); load([RootName 'Channels_all.mat']); Channels_all{26}.CorrectchId(end) = []; Channels_all{26}.Correctch(end) = []; params.pre = 0.5; ...
4d1b00abf524a2140c336d4c5b2852655154404509c7065af5a7c5700f4d1e40
MATLAB
4,062
123
function out = getButtonClick(stopTime, varargin) % Wait for a mouse click on one of several buttons, or until a timeout. % % Get the click on a button that was created with createButton. The first % argument is the waiting time in seconds, followed by one or more button % handles as returned by createButton. The funct...
d3d587af231b831dd0c81f319c0393a08dc3e7c72eed7a6a8ef0aede3b4c8ef5
MATLAB
4,067
162
function inv2 = de_ftab_inv2(fit, sl, varargin) %function inv2 = de_ftab_inv2(fit, sl, [options]) %| %| Build object that does polynomial inverse of BH function. %| (To map log data into corresponding to line-integrals of material density.) %| %| in %| fit strum initialized by de_ftab_fit() %| sl cell {s1, ..., sL} se...
0cb539bbd17fdb9f1c8dabdf740b0f5bdf75e214deed0726e630e7be3a3d3eae
MATLAB
4,070
107
function k=LineCurvature2D(Vertices,Lines) % This function calculates the curvature of a 2D line. It first fits % polygons to the points. Then calculates the analytical curvature from % the polygons; % % k = LineCurvature2D(Vertices,Lines) % % inputs, % Vertices : A M x 2 list of line points. % (optional) % Li...
ded9176818182acb27f53954af236a25bef4e9b97362644f0bead192d8c16841
MATLAB
4,070
180
function ir_savefig(varargin) %|function ir_savefig([rootdir,] base, ['c']) %| %| save current figure to eps file rootdir/base.eps with prompting. %| %| matlab's newer 'exportgraphics' is perhaps more useful %| %| options: %| 'eps_c' save to color .eps file without inverting! %| 'cw' color .eps file for use in white ...
6862903630d138ea020956f57d97b4b14b38cf97f20118126f4c14f165424856
MATLAB
4,073
75
clc clear rats=getfolder for i=1:length(rats) cd(rats{i}) SD=getfolder; for ii=1:length(SD) cd(SD{ii}) trial=[repelem(7,1,300)]; %Create a vector for trial (300 sec of wake name with 7). trial6=[repelem(7,1,600)]; files=dir; ...
49014d1fcbd2a8594d814d8b91b087b91cde2a287aeb062ccaf830dc456b91af
MATLAB
4,074
141
function out = spm_dartel_warp(job) % Register images to template data. % format spm_dartel_warp(job) % % The outputs are flow fields. %_______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % John Ashburner % $Id: spm_dartel_warp.m 7182 2017...
a140bee9d61b13020ead3e034f6cff00605bb425abd5caf6aec017683a00e549
MATLAB
4,074
109
function outSignal = IPEMReshape(varargin) % Usage: % outSignal = IPEMReshape(inData,inShaper,inMethod,inSymmetry,inPlotFlag) % % Description: % Reshapes the incoming data by substituting each original value by a % new value using the given shaper matrix. % % Input arguments: % inData = 1D data vector...
52a379606f7066eb02af75918ba9cd559e9573f2329642a698e3c8d11e3f0d52
MATLAB
4,076
92
function total = dotPresentationBirds(trackingAreaSize,trackingAreaSteps, stimulusSize, stimulus, resultsPresentationHuman, errorMargin) % This function is used in conversionMatrixCreator_Birds to display stimuli % in the desired tracking area and to track pecks on those stimuli. % % INPUTS % * trackingAreaSize ...
b8c93ba1597260d3393dca84e2b9ccce78c8f90dbb221b1cdfc1922d857688a6
MATLAB
4,079
125
%Convert old Condition files %Inputs: structure from old files %Outputs: structure with data in new format function New=convertOldConditionFile(Old) %% ConditionsMatrix %convert pages (Trial) to commam delimited New=struct(); for i=1:length(Old.ConditionInfo(:,1)) Trials=Old.ConditionInfo{i,1}; TrialsSplit=st...
61f95640d86cf92bd867a10b02d7b6cac6e2a761c9ae79e99d297d49b2bb301c
MATLAB
4,080
108
% The script is used to perform pairwise decoding on fMRI data % add toolbox addpath(genpath('spm12/')); addpath(genpath('CoSMoMVPA-v.1.1.0/')); addpath(genpath('libsvm-3.25/')); % set input and output paths beta_path = '../../mri_data/beta_map/'; mask_path = '../../mri_data/mask/individual_space/'; save_path = '../....
785a70fa53dec87688bbb19b638f6091d11022898df9c7ed3355e6ad66dda5f2
MATLAB
4,085
138
function bmask = pm_brain_mask(P,flags) % Calculate a brain mask % FORMAT bmask = pm_brain_mask(P,flags) % % P - is a single pointer to a single image % % flags - structure containing various options % template - which template for segmentation % fwhm - fwhm of smoothing kernel for generating mask %...
df57581dd3b9378012513a8d2de089d305f433e6525d66a87a0527a9b94282ee
MATLAB
4,085
108
% THETA BATCH ANALYSIS PIPELINE % MH 2020 function theta_phase_batch_pipeline(option,computer,plot_select,varargin) % option: 1- phase precession ; 2 - extract directional clusters and place fields ; 3 - extract theta extrema ; 4 -bayesian decoding ; % 5 - Theta sequence quantification ; 6 - shuffles ; 7 - finding the...
75df43b21e8ac9eb91a24c6e0802bcf46a5ad9ef4a51d4342488f418488530b3
MATLAB
4,086
109
function[]=ref_vol_stitch_after_BASIC(id,datapath, depth, thickness) Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; resize_factor=0.5; % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/ThorOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_...
9f98ce4c4c4709013460896f8bbe2d07af717384f3aabca4b9a0607073e0ea4d
MATLAB
4,086
104
% sense_recon_demo.m % - demonstrates use of sense_recon.m, which implements the SENSE % reconstruction % - figure shows how Tikhonov regularization mitigates the increase in error % as noise variance increases % - applies complex AWGN to kspace % - image must be even both directions % % 2012-06-08, Mai Le % number...
45916588ddb6caf4705895feb7a2ab2c9caf4520679a523b07c8f48de29ceb5d
MATLAB
4,087
107
function varargout = IPEMHandleInputArguments(inPassedArgs,inNumFirstOptionalArg,inDefaults) % Usage: % [...] = IPEMHandleInputArguments(inPassedArgs,inNumFirstOptionalArg, % inDefaults) % % Description: % This function is a simple but general input handling routine. % Ju...
2c05121dd6ab056037ad42b4eed751fd9309bfbcd879c38923410e78bbbb57f7
MATLAB
4,089
85
function [input_graph, new_link_info] = fun_graph_pruning_convert_node_to_endpoint(input_graph, node_label) % fun_graph_pruning_convert_node_to_endpoint convert a node of degree 1 to % an endpoint. If the node contains more than 1 voxel, select one of these % voxels that connected to the link. % Input: % input...
dcbf6a8d7c938351003f7db71db8947cdbdb154b470955d81178374aad583704
MATLAB
4,089
110
function [negloglikelihood] = Estimate_g2_g3_sigma_nu(g2, g3, sigma, nu, Input, config) % Zilong Ji, UCL, 2022, zilong.ji@ucl.ac.uk % Find the likelihood with parameters specified in the model function name % Args (in common between all estimates functions): % beta: decay factor for the mental distance (calculation err...
aa465cb0c1598110f17359dce33481bcbf316d57c4a6258a7d1c9e8ef2d5ce0e
MATLAB
4,091
87
function connect_link_str = fun_graph_shortest_path_through_4pts(metric, ep1_sub, bp1_sub, bp2_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 betwe...
7eeb006148f60e8b6b09896a1b7828795ba1537e4a6fc8285238559dcc2201bc
MATLAB
4,093
146
function [M_R] = vox2ras_rsolveAA(Vc_C, inPlaneRotation, varargin) %% %% NAME %% %% vox2ras_rsolveAA.m (vox2ras_r{otation}solveA{uto}A{lign}) %% %% AUTHOR %% %% Rudolph Pienaar %% %% VERSION %% %% $Id: vox2ras_rsolveAA.m,v 1.4 2007/01/10 22:55:10 nicks Exp $ %% %% SYNOPSIS %% %% [M_R] = vox2ras_rsolveAA(Vc_C,...
92fe7d6c5c02a7d28b1c4c830bbffbfff567ba368b834547337317bc4f1c22b9
MATLAB
4,093
134
function [nodes, edges, validatedNodes,validatedEdges] = regraphNodes_new(nodes, edges,validatedNodes,idx) % Re-graph nodePos = nodes; nodeEdges = edges; nNodes = size(nodePos,1); nEdges = size(nodeEdges,1); if ~exist('nodeDiam') nodeDiam = zeros(nNodes,1); end hxy = 2; hz = 2; nNodesUnique = ...
869ab8ac8b227a71e879e7b5f7be71e98345421eaceba24dfae548254be10982
MATLAB
4,094
95
% specify OCT system name sys = 'PSOCT'; % specify dataset directory datapath = strcat('/projectnb2/npbssmic/ns/201028_PSOCT/dist_corrected/'); addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code...
ab19917b54dbed7f380706e2352a5eea460851cfe12354d51b9d212bf6f40d6b
MATLAB
4,094
148
% header = ufmf_read_header(filename) function header = ufmf_read_header(filename) MAXNMEANSCACHED = 5; header.filename = filename; % open the file for reading, binary, little-endian fp = fopen( filename, 'rb' , 'ieee-le'); header.fid = fp; % ufmf: 4 s = fread(fp,[1,4],'*char'); if ~strcmp(s,'ufmf'), error('Inval...
ad4546aff9b607c98f7d29cc8954f97546854d279293d2bd51bb0782e0e2543d
MATLAB
4,094
153
master_startup; example_rats = {'B052', 'T261', 'B104'}; %% plotting examples of different types of history effects that are observed in the dataset: fprintf('\nPlotting example fits \n\n') figure(2001); clf; idx = find_rat(example_rats, ratdata); bin_wd = 3; range = 32; markersize = 12; ylabels = {'Fraction c...
8df4ac712700a39a581e8190f75ef96dc75799b3dc3bab5406ba957a30adabbc
MATLAB
4,096
111
%Get data for Data Type Events %Inputs: app properties %Outputs: numTrials and Events for Data Type Events function [numTrials, Events] = GetEvents(app) %Determine which Detections Setting is being used, currently there is only one option app.DetectionSetting = app.DetectionSettingsDropDown.Value; switch a...
de996803a93b8511cfd80982b64f24665aa0cd01646d58d0c208adcea4aac429
MATLAB
4,101
116
function spm_vb_ppm_anova(SPM) % Bayesian ANOVA using model comparison % FORMAT spm_vb_ppm_anova(SPM) % % SPM - Data structure corresponding to a full model (ie. one % containing all experimental conditions). % % This function creates images of differences in log evidence % which characterise t...
1cff694e592dd5229980de7d5788ab095b9b7189c261357b13e075645da7836b
MATLAB
4,106
129
function [ outputMap ] = generateColorMap(map, type) %GENERATECOLORMAP % This code generate a color map based in the results obtained from the % HELICoiD classification result. It assigns colors depending on a class % list and the label in each pixel of the classification map. % % INPUTS: % - map: 2D ...
287968703111b7a42aa5fd79284fdc862b0d611fe571a8ccf15db5300440d62d
MATLAB
4,106
90
function Figure_7C_plot % % Written by Ayaka Matsumoto, October 2023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Output: Figures 7C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% param_...
47bd7239f8afd0056b4c7a6acdb34406a214368a2f2398797b676c5955d2f309
MATLAB
4,106
85
% Denoise Poisson images using the Anscombe variance-stabilizing transformation, BM3D filter, and the exact unbiased inverse of the Anscombe transformation % % [y_hat, PSNR_y_hat, NMISE_y_hat] = Poisson_denoising_Anscombe_exact_unbiased_inverse(noisy, original) % % the input D is the filtered (e.g., denoised) signa...
e4b4bdcb62deda0c27583f1604f8e897e184fb9daf8296485c5c20655201dd37
MATLAB
4,106
149
% This is a wrapper function to the MEX function stepFast.c function stepMex(obj, nStep) % Select which step function to use stepFunc = []; if(obj.useLocalJumps) if(obj.typeFlag == 4) stepFunc = @obj.stepFastLocalChem; else stepFunc = @obj.stepFastLocal; end else % This function...
9af1e1dfe1f4657664d3aed6bb592876ddde089f3301aea64247b6666b447756
MATLAB
4,107
109
function trigSDFandMI_M1(sesID,tsDir,trigDir,algTrigDir,rrmDir,analDir) % function trigSDFandMI_M1(sesID,tsDir,trigDir,algTrigDir,rrmDir,analDir) % % input: % sesID session ID % tsDir path to dir of preprocessed data for RRM % trigDir path to dir of triggerTimes for (no-)movement ons...
06fd0d419bdb70a893fe0c142a4f70ff8bb63cc2d7646bbd95e0408f115773f2
MATLAB
4,113
123
function plot_timewarped_lickBehavior(cells) % Plots Timewarped Lick Accuracy: 30 min post-start; 30 min post-control; % 120min post-ketamine addpath(genpath('/Users/KeiMasuda/Documents/MATLAB/Add-Ons/Functions/gramm (complete data visualization toolbox, ggplot2_R-like)/code')); seshes = unique(cellfun(@num2str,cells...
73ca1c118aaa14c163e576f36bdc5a8b185b88e6504f3a7352b3459d1808fc38
MATLAB
4,113
152
function [Fcompvec, RESNORM, Fcomp, dmean, Cmean] = inspect_map_F_update(allimg,FcompvecPrevStep,weights,K,Kalpha,gradechoinv,options) ncomp = options.ncomp; nvox = size(allimg,1); Nmeas = size(allimg,2); %Nk1 = options.ILT.Nk1; %Nk2 = options.ILT.Nk2; %Nk = Nk1*Nk2; Nk = options.ILT.Nk; %boolean denoting whethe...
745b7a8ad6764395626fe2679d5867d5b2dded611890bc7852fc1d90b16b5b23
MATLAB
4,114
95
folder = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_20T/AD_10382/'; P2path = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_20T/AD_10382_2P/'; % 2P file path datapath=strcat(folder,'fitting/'); % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitti...
d118826a7f1f496bae1a9d2cd884ad78bb491644349f2f0ce8d63dbf9058bf72
MATLAB
4,121
119
function [fNum] = plotTurnDensityRadialOccupencyCorr(radProbAllGen,turnDensAllGen,genAll,fNum) posDiff = [];turnDiff = []; for g = 1:numel(genAll) posDiff(g,:) = radProbAllGen{1,g}.during.weightedMu-radProbAllGen{2,g}.during.weightedMu; turnDiff(g,:) = turnDensAllGen{1,g}.Dur-turnDensAllGen{2,g}.Dur; end...
987a489c8a141b5cf20fc0d02d62596ccdc78ff23f75db17ed13a106f3e991dd
MATLAB
4,125
123
%% Comparison of volume headmodels % % Vinding, M. C., & Oostenveld, R. (2022). Sharing individualised template MRI data for MEG source reconstruction: A solution for open data while keeping subject confidentiality. NeuroImage, 119165. https://doi.org/10.1016/j.neuroimage.2022.119165 % % Get summary statistics of the ...
0e62055c8c74ac7b090f41ab3ae83b86af7e624c172c8a7dd727f644549eeb5a
MATLAB
4,126
156
function [mean_pos,ma_pos] = mean_posit_track(t,s,tau,train_len) %| function [mean_pos,ma_pos] = mean_posit_track(t,s,tau,train_len) %| INPUT %| t: time indices %| s: position sequence (should be same length as t) %| tau: delay parameter, %| set to be the equivalence index to about 0.5sec for breathing. %| train_Le...
69db5b6d86443dd8102b39e34d16e3e7c95d577d349c1ceb8908821f0ffcf221
MATLAB
4,134
98
function outFrequency = IPEMCalcNoteFrequency (varargin) % Usage: % outFrequency = % IPEMCalcNoteFrequency(inNoteNr,inOctaveNr, % inRefNoteNr,inRefOctaveNr, % inRefFreq,inNotesPerOctave, % inOctaveRatio) % % Description: % C...
c50896648ee9c6ffa769413e048620d6f42b2ccfe041f329169be62af9c234c6
MATLAB
4,140
115
function x = spm_invTcdf(F,v) % Inverse Cumulative Distribution Function (CDF) of Students t distribution % FORMAT x = spm_invTcdf(F,v) % % F - CDF (lower tail p-value) % v - degrees of freedom (v>0, non-integer d.f. accepted) % x - T-variate (Student's t has range (-Inf,Inf)) %________________________________________...
934ad04a1bc2c378fb6e9a664d4164aa8ed2d8d74003d18c87ed2e1d33d5463b
MATLAB
4,141
120
function nodes = centerNodes_transversePlane( nodes, edges, I,verifiedNodes, idx ) nodes_len = size(nodes,1); if nargin < 5 idx = 1:nodes_len; end len = length(idx); new_nodes = nodes; I = permute(I,[3 2 1]); [ny,nx,nz] = size(I); h = waitbar(0,'Please wait... Centering nodes(1 and 2 edges)'); for v = 1:len i...
f5921a90700ac49849b0a078022725e11e32dfd646079f504418abf63dcb15e0
MATLAB
4,141
125
function [mx,my,mz] = blochsim2(Mi, bx, by, bz, T1, T2, dt) % Evolve magnetization field using time-discretized Bloch equation % Input % Mi [3,dim] initial X,Y,Z magnetization % Note: normalized to magnitude <= Mo=1 % bx,by,bz [ntime,dim] effective X,Y,Z applied magnetic field % (Tesla), for rotating frame (...
708a6529a34b4eeaa99c2fee7cd4d5e0bb6eb9af437abddee9c418aebc335147
MATLAB
4,143
71
%% clc; clear all; close all; load('bgluSynchData_forRM.mat', 'bgluRawSynchData'); %% cond0g_0b_div14 = [bgluRawSynchData.SF147.cond0g_0b.div14.SF14.rawCleaned; bgluRawSynchData.SF147.cond0g_0b.div14.SF47.rawCleaned; bgluRawSynchData.SF147.cond0g_0b.div14.SF71.rawCleaned]; cond0g_0b_div15 = [bgluRawSynchData.S...
949c456e35c18cc908274ecdd3890d2ffe7d4b8b93a2b2e75fe9e2bbb7329dc2
MATLAB
4,145
119
function main %-- Settings rotation_randomization = 0; nRotations = 18; voxelization_type = 'binary';%or 'density' binaryMax = 1; basic_dimension = 28; %The final size is this + 2*D D = 4; %Padding output_type = 'bin'; %or 'mat' aligned = 'aligned'; %or 'nonaligned' rotation_start_index = 0; collate_singlerots = 0; ...
8451df4c5d901e19d7942e2002fba3a88c7d365fb784945a53e26d9aa230a325
MATLAB
4,148
153
clear all; %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters xx=200; xy=0; yy=200; yx=0; % mosaic parameters numX=22; numY=23; Xoverlap=0.5; Yoverlap=0.5; % tile parameters Xsize=400; Ysize=400; numTile=numX*numY; grid=zeros(2,numTile)...
5a315175af8f4eb2b53bdbf212fa348c8d12d5d54aad37f22da0a5bfa0cadbd1
MATLAB
4,152
98
function [nwbAll, importLog] = NWB_importFromFolder(datasetPath, importRange, taskFlag) %NWB_importFromFolder Returns a cell array containing all imported nwb %files in the specified folder and import range. % pathIn: Path to desired folder % importRange: Range of SB/SC IDs to import. % % mkyzar 4/15/2023...
3a52cc32785e6c3da63e567c597e14f4db5ae2f80423480498fe5def7b967316
MATLAB
4,155
104
function [I_VE,I_seg] = vesSegment(I, sigma, thres) % This function performs 3D vessel enhancemnt, filtering, and thesholding % to segment the vessels from the surrounding tissue. % % INPUTS: % I - inverted 3D angiogram (white = vessel, non-white = tissue). % sigma - vector of standard deviation values of gaussian ...
1da239d705816e6a97a710ff03b336324269d77b323072aeaf68ce290029d2fb
MATLAB
4,156
125
function [M_avg,d] = spm_compute_avg_mat(Mat0,dims) % Compute an average voxel-to-world mapping and suitable dimensions % FORMAT [M_avg,d] = spm_compute_avg_mat(Mat0,dims) % Mat0 - array of matrices (4x4xN) % dims - image dimensions (Nx3) % M_avg - voxel-to-world mapping % d - dimensions for average image % %____...
60236a81954fb54c38ed6fabcb71e374bd831360c36b305e66b2716576b37856
MATLAB
4,156
79
function [shuffled_track,all_shuffles] = parallel_shuffles_final_lap(shuffle_choice,analysis_type,num_shuffles,decoded_replay_events) % runs run_shuffles on multiple cores in parallel shuffle_choice- determines what type of shuffles will be performed, entered as a string % % analysis type- vector of 0's and 1's for whi...
de287d020dc209dc7aaeeb1a00e0d24cefc758f51b24dacdd1e20dcebed37443
MATLAB
4,157
152
classdef c_GUI_uix_VBox < c_GUI_handle % c_GUI_uix_VBox - wrapper around uix.VBox() that automates handling of children heights properties DefaultHeight; DefaultFixedHeight; DefaultMinHeight; end properties(SetAccess=protected) hbs hb h_scroll; numChildren = 0; childHeights = []; childMinHeights...