sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c979a6f41e296d312d7d6fd9e16caa76fd1a31c70c175eb7ceac5197d0dc4aad
MATLAB
5,698
115
%% IR74 Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if isempty(strfind(path,'fieldtrip')); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = 'IR74'; SBJ_vars.raw_file = {'...
8e3ba2af5f7226228c84ba03fe1c9155e9e685ebbb734da49f1106fce9b6c7ea
MATLAB
5,703
194
%% Time-Frequency on Raw Data % ####################################################################### % Steps: % 1. Load Raw Data % 2. Perform TFR % 3. Save TFR for each subject % ####################################################################### %% clear ft_defaults %% Subjects % ID 18 missing because of...
16a8053df94089952de4a03d34963612ad440212d9b503e0b0a434fdb17ac5a2
MATLAB
5,705
130
% bdnfSynchData_forRM.m %% PART 0 - set colors clc; clear all; close all; % actual colors to use myColors(1,:) = [0 0 0]; % black myColors(2,:) = [1 0 0]; % red myColors(3,:) = [0 0 1]; % blue %% PART 1a - GATHER DATA % % % * * * * * * * * * * % % % ready2save = 1; % * * * * * * % % % % * * * * *...
98a9feee98d652449df7139556875c46cead19b56eb7fcd6526d6c4a2e8a978b
MATLAB
5,705
168
function nc_Figure5a(bsIter) % Figure 5a - Symmetry of R1 over the lifespan % % nc_Figure5a([bsIter]) % % This function will reproduce Figure 5a showing that a parabola is a good % fit of the R1 lifespan data and Figure 5b showing that R1 changes are % symmetric over the lifespan. % % Inputs: % % bsIter - Number of b...
c17429e94486cbfc36b78bf7f9fe746e606292d83dae6fa7a9a2e9c21d8f539c
MATLAB
5,709
179
% Demo of a linear Hawkes process where the E neurons are organized on a % ring % Wen-Hao Zhang, July 2, 2019 % University of Pittsburgh %% Parameters of the model parsHawkesNet; % parsMdl.Ne = 180 * 40; % parsMdl.tLen = 2e3*1e3; % unit: ms parsMdl.tLen = 100*1e3; % unit: ms parsMdl.bSample_ufwd = 1; parsMdl.jxe =...
eba4afb077eef2d9cd3cf08ad6fa8c0ceb7b73d9a663c8fb7d63f2e2a5301b2c
MATLAB
5,711
177
%% Analyzing Neural Time Series Data % Matlab code for Chapter 15 % 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. % Mike X Cohen...
76fb744b398d4e6070c6ac3621959344657e71a5a052e05b4a5e0d2f40f27695
MATLAB
5,712
149
function example_cell_plot_tsc_II(ID,tWindow1,tWindow2) %EXAMPLE_CELL_PLOT_TSC_II Demonstration of a rhythmicity group member. % EXAMPLE_CELL_PLOT_TSC_II(ID,TWINDOW) plots the activity of the given cell % (ID) from a recording between TWINDOW(1) and TWINDOW(2) seconds; and % also the the autocorrelation of it...
fc453fea1453a94ff300e5b408fa5b11645819e155f3cdc774161d9dca62c1db
MATLAB
5,718
137
function nf = fun_graph_get_node_features(cc_ind, vessel_image, vessel_mask_dt, image_size, compute_feature) % fun_graph_get_node_features computes the node features including average % intensity, average radius, center of mass, radial node density % distribution, local neighbor distance and label, nearest neighbor % d...
9b4953ea37f6eb33fde662affde3b69e305e726d0ad69a18ffeb02f8d1f62aa3
MATLAB
5,721
238
function [C, ugibb] = Csparse(arg0, arg1, arg2, arg3) %function C = Csparse('b2info', kappa, mask, chat) %function C = Csparse('center', Cscale, mask, chat) %function C = Csparse('maskleak', mask, chat) %function C = Csparse('maskleak3', [beta_xy beta_z], mask, chat) %function C = Csparse('maskbar', mask, chat) %funct...
e795ccd6053ec511285c93d9b8059d4bc290fd601d782d354c876ba1f4bb5eb7
MATLAB
5,721
180
%== main function for plotting rasters. % % SPIKERASTER - Spike raster of multiple neurons % SPIKERASTER(spikes, options), plot spike trains given in variable % SPIKES, which is in format [neuron time] or in a sparse matrix % with time down columns and neuron number across rows. If % there are no spikes (S...
d86d741a6999ac4209b011f16cab938b7f2314b32c29f9fa337cb134bee9c408
MATLAB
5,724
131
function [Im, wtCoarse, wtFull] = CoilAdaptiveCombine_V2(Im_coil, blocksize, trainingsize, bInterp, Rn) % 20230615 update: line 98 changed: delete sqrt % Input: % Im_coil: Nrow x Ncol x Ncoil 256 256 32 % blocksize: size of the image block % trainingsize: size of the training region % bInterp: if true, interpol...
b80a3788d6f03675425142c5402af01555d5147c14c1521d09a3fe399a736c6b
MATLAB
5,725
182
function [L,D] = spm_eeg_lgainmat(D,Is,channels) % Load or compute if necessary a gain matrix % FORMAT [L,D] = spm_eeg_lgainmat(D,Is,channels) % D - Data structure % Is - indices of vertices % % L - Lead-field or gain matrix L(:,Is) %__________________________________________________________________________ % C...
3ccfb502e744ed319debff8858517fd86ef50af1548ba281c3b788cd062a6887
MATLAB
5,732
165
function EEG = c_EEG_resample(varargin) p = inputParser(); p.addRequired('EEG',@isstruct); p.addRequired('newFs',@isscalar); p.addParameter('method','eeglab'); p.addParameter('doResampleAuxData',true,@islogical); p.parse(varargin{:}); EEG = p.Results.EEG; if p.Results.newFs == EEG.srate c_saySingle('New sampling rate...
e2c5f65bca9623e18aedb4ed05b448985b02aea7261fbb31b9f8c5719ea1997a
MATLAB
5,732
145
% 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 % compari...
d3066952fd64e407c3a81702913bd54817a6cdaef75a35689a2a6d3e71ae11c3
MATLAB
5,740
143
phase_regions_list = {'TEMP'} power_regions_list = {'CA3'} %% initializa group matrices for each pair of regions and each condition % cortex w/ MTL if strcmp('OFC', phase_regions_list) | strcmp('FRO', phase_regions_list) | strcmp('TEMP', phase_regions_list) && strcmp('MTL', power_regions_list) group = {'3...
a5cc50631ad80d3de7241494381287b673c57bf83c6c5508226e6476165f2c9b
MATLAB
5,741
183
function imfs=emdx(data,varargin) % EMDX - perform empirical mode decomposition on channels x time x trial data % % Usage: % imfs = emdx(data[,maxorder,standdev]); % % Inputs: % data = [chans time trials] input data (can also input [time trials] % or [time] data) % maxorder = (optional) ...
39f6fbd2b392fab6e69d2de6b8f3dc9d29fb3ecd74f9e941f6eacc38168c1b02
MATLAB
5,743
142
function compute_lgi (pial, outersmoothed, fnormal, nsteps, radius, outdir) % Original Author: Marie Schaer % Date: 2007/11/15 % % This function computes final local GI calculations, based on previously % measured area for outer surfaces ROIs (outer_ROIs_area.mat) and on their % corresponding regions of interest on t...
1cba334c04c89912e3f3c72306a2531b1366b088f59b4a5b72484e5a88709e58
MATLAB
5,746
128
function Gen_OCT_coord(datapath,disp,mosaic,pxlsize,islice,pattern, plane1, plane2, plane3) %%% ---------------------- %%% % 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, %...
a5ee48549a32f12ccf1a8402850fb510e9875780edba3b1255712f20cdacaf53
MATLAB
5,748
221
function [coef codes] = ir_odwt2(x, varargin) %function [coef codes] = ir_odwt2(x, varargin) %| %| 2D orthonormal discrete wavelet transform (ODWT) of 2D image x. %| Also provides the adjoint, which is the inverse ODWT. %| %| in %| x [N M] image %| %| option %| 'level' int default: 1 %| 'wname' char default: 'haar' %|...
3d5e2c2adb676fad3532feed2634cada001ce483cc073d3e096c773c79100c90
MATLAB
5,750
137
function [ens_nodes, results] = find_temporal_ens_nodes(best_model,shuffle_model,data,stimuli, num_controls) % FIND_TEMPORAL_ENS_NODES Find multi-timeframe neuron ensembles with CRF models. % % Input % best_model: Trained CRF model to analyze. % shuffle_model: Shuffled dataset CRFs. % data: Expected to be a timef...
ab56027b6b0953acd498d7b4b53d737112a613cff3ae6a3a892bf7d7489c2cad
MATLAB
5,752
155
% Optimality deviation plots for paper clear all clc close all no_tit = 1; input_options = struct; input_options.show_tit = ~no_tit; input_options.rank_regression = 0; plot_transition_dist_also = 0; % (0) listLength_inclusion_criteria_spans_both_task = 0; % (0) if 1 then excludes any subject who...
c57b6fad47ffa15d6a447e486566638e2d3ef914ce5e193cb044154cb5831268
MATLAB
5,757
190
function [pos] = plot_stats_permtest(stat,data_avg1, data_avg2,fsample,timestep,csd,length_k) % plot_stats_permtest(stat,data_avg1, data_avg2,fsample,se_data_rare_cp, se_data_freq_cp, se_data_rare_fc, se_data_freq_fc, csd) cl = cbrewer('div','RdBu',100); % substract conditions from each other cfg = []; ...
7109a25aa9fa63b4ced81332057a706003251ee1f05dde64e41bae7b9fed307c
MATLAB
5,758
156
function [vertices, faces] = freesurfer_read_surf(fname) % freesurfer_read_surf - FreeSurfer I/O function to read a surface file % % [vertices, faces] = freesurfer_read_surf(fname) % % Reads the vertex coordinates (mm) and face lists from a surface file. % % Surface files are stored as either triangulations or quad...
b44c5fbbe9c09115d99becf528835460e2fe796191842d4858f273dd777d67b0
MATLAB
5,758
158
function pointsI = circOpposingNearestPoints(pointsI, x, startI, endI, ... searchLength, varargin) %CIRCOPPOSINGNEARESTPOINTS Find the nearest equivalent point indices on the % opposing side (within a search window) of a circular vector. % % POINTSI = CIRCOPPOSINGNEARESTPOINTS(POINTSI, X, STARTI, ENDI, % ...
e6d26a676f555d0e4f862b08b04488483bd61eecf8e7fc46f2f0cc00e842fc10
MATLAB
5,759
95
function PV_corr_leave_one_lap_out % MH 2021 % Runs population vector analysis comparing within a track, each lap's ratemap to the remaining laps ratemap. E.g. Track 1 lap 2 compared to % laps 1 to 16, but excluding lap 2. % Load name of data folders sessions = data_folders; session_names = fieldnames(sessions); ses...
5fc106956cf751dd395619ff0b6e9b3a1db49b2c3b10fc1d0b82716aa5496be1
MATLAB
5,760
56
close all clear variables clc %Varun Mannam %date: taken from 29th Sep 2019 %date: 27th July 2020 %DnCNN model with diff lr in keras %calculate the PSNR on test-mix data raw nbn %1e-3 100 epochs with adjust LR and weights initialization %5e-4 200 epochs with adjust LR and weights initialization %1e-4 200 epochs with ...
b6ef64543545a06c806b48233e0009e9ff95cfed98ea36285f1d52ca95b59d8c
MATLAB
5,767
180
% run A003, then A011, then this subj = '57' cd(['/mnt/yassamri/iEEG/sandra/subj_' subj]) if strcmp(subj, '55') load('elec_loc_wrkspc.mat') end addpath(genpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final/fieldtrip-20181130')) load(['/mnt/yassamri/iEEG/sandra/subj_' subj '/FT_Pipeline/Electrodes/IR' subj '_...
ce0e209c93e939d45e7dd0f87bed3949701ae3d12a38ecdf448e23c10a43ac90
MATLAB
5,771
188
function examplestim clear close all; E.levelsC5 = [48 0 48 48]./100; E.levelsC7 = [0 48 48 48]./100; stimorient = 360.*(rand(36,1)); ST.npixelsperdegree = 36; % VPixx pixel resolution at 57cm ST.gratingsize = ST.npixelsperdegree*2; % ST.gratingradiusfactor = ST.npixelsperdegree*2; % previously 128 ...
d2330dfbadf483e0d5119c6d74a3d8f1f519d245417b8c45cec686fab3ff7598
MATLAB
5,777
128
function [globalBursts_beginI, globalBursts_endI, globalBursts_Elecs, globalBursts_NumBInGB, ... globalBursts_width_iter, globalBursts_AvgWidth_iter, globalBursts_AvgWidth_sec, globalBursts_AvgNumBInGB, ... NumGlobalBursts, globalIBI_iter, globalIBI_iterAvg, globalIBI_secAvg] ... = detectGlobalBursts(Num...
44b8ebd2b027c321b683c2293e361f0bb5197303c0110eaec365716a99f542be
MATLAB
5,783
160
function FunctionalConnectivity_Fig5 rootdir = 'C:\TKlab_agingPFC\'; cd(rootdir) load FunctionalConnectivity %% Pairwise correlation as a function of distance: Across age groups -Ver2 figure( ... 'Position', [0 100 1050 1250], ... 'PaperOrientation', 'landscape', .....
21f2b80c8be073fd1735206b7cff6c3d981e7a31aa066a7307b9bfae26bb53e8
MATLAB
5,784
182
function [] = genGenData(genAll,meta) % This function creates a general file for each genotype with information % about all flies for that genotype % % Inputs: % genAll: cell array of genotypes to consider % meta: Type of points we want to return (3 options) % meta.foldRaw = folder with the original data fi...
ff3d52742478378b2cb26295b13a5a26ae3cac9be85a993d1be77f3dd65cd9d6
MATLAB
5,787
198
function [probas, Isubj,nf]=taldir(dirname, th_pval, DirTable) % % Computes the probability of the Talairach transform matrices % of all the subjects found in the directory "dirname". % Uses the mean vector and covariance matrix obtained with talairachin_table.m from % the data set (default data set: /space/...
0bf5fd31e26d3102533e75f571dfc22295b9a34f7b9218e754c6fdacc15d7b65
MATLAB
5,792
181
function[]=ret_vol_stitch_from_AB_no_ds(id,datapath) % mosaic parameters Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; % 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_code/NIfTI_20...
4e6ee8d9bf1f638f8057e6f1f8e4f9aab22fefe7f07a545a24187da625287255
MATLAB
5,792
140
function SVM_object_decoding_full_experiment_searchlight(subject,task) %SVM_OBJECT_DECODING_FULL_EXPERIMENT Perform object decoding (average of pairwise object decoding) using the SVM classifier. % %Input: subject ID, task (1=categorization, 2=fixation) % %Output: NxNxP vector of accuracies in %, where N is the number ...
38f1839d9be768eaa8279656ada57b849f2974063a0c6f63199b7e8951955622
MATLAB
5,799
128
function Gen_2P_coord(datapath,disp,mosaic,pxlsize,islice,pattern, plane1, plane2, plane3) %%% ---------------------- %%% % 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, % ...
aea9188f20438dd1ae3455d9b8a155543b078f6275b220ea7bf7b4d426105a89
MATLAB
5,799
160
function sulcus_vertices = get_sulcus_info(session, run, neurovascular_map, UF, varargin) % GET_SULCUS_INFO Return the ROI matrix for a given session/run combo. % If no ROI matrix exists for a given session/run combo, allow user % to create and save the ROI table. % % INPUTS: % session: scalar double;...
e55b8995a829c48c0ce11fb8449e42fbc6ade391d47fa6c296f27b34dc0a09f5
MATLAB
5,803
155
function Stitch_2P(datapath,disp,mosaic,pxlsize,islice,pattern) %%% ---------------------- %%% % 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, % ...
3ffe2469e0d1a6953344ca44ddc4dfa053d8bfad5b76c011e8d4d22ea95b5e4e
MATLAB
5,806
147
function BHV02d_RL_model_plot_grp_predictions_bar(SBJ_id,proc_id,model_id,plt_id,save_fig,varargin) %% Plot model predictors across group averaged within condition % INPUTS: % SBJs [cell array] - ID list of subjects to run % proc_id [str] - ID of preprocessing pipeline % model_id [str] - ID of the model parameter...
65837d8708c398c1e45e8b7e5147d2692b9d1aa234a7f2ec10d5a3777ee4d788
MATLAB
5,810
112
%% ${SBJ} Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if isempty(strfind(path,'fieldtrip')); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = ''; SBJ_vars.raw_file = {''}; SBJ_var...
d5bca3bd9f5037cdf58e4ef23b4ada0afa5b3b2f5e9850afa5b08acd80184726
MATLAB
5,810
131
% bgluSynchData_forRM.m %% PART 0 - set colors clc; clear all; close all; % actual colors to use myColors(1,:) = [0 0 0]; % black myColors(2,:) = [0.6 0.6 0.6]; % grey myColors(3,:) = [1 0 0]; % red myColors(4,:) = [1 0.6 0.6]; % light red %% PART 1a - GATHER DATA % % % * * * * * * * * * * % % % rea...
b52fc89aae855912a0f90d1f126a1a019e508e768f25e9f3042aa12dff1a024a
MATLAB
5,820
200
function create_cum_sum_replay_figure cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\figures\combined figures' axn = replay_cum_sum_makeFigure; cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\figures\Sum cumulative replay' sleep = openfig('Cum...
55d2e1d3774058a6ed75aa37d2381cbc5f03a9e008cf82fb5f1e0b0ae7019197
MATLAB
5,826
131
function [transpa,hIm]=plotResponses(roiHSV,peakParameter,peakResponse,peakParameterStd,im,totalCells,mapData,roiHSVRescaled,peakResponseLabels,peakParameterStdLabels,cellper,pixROIs,mx,remap,transpa,hIm) figure screensize = get( 0, 'Screensize' ); set(gcf,'Position',[screensize(1:4)]) hIm=subplot(1,...
fdeaf190fcdfda67765e19109e17100e193190ea7bf8eaf2e276f129fe10e841
MATLAB
5,827
178
% close all clear all npx_init; clear all npx_init; %General parameters color_shanks=0; starting_point_plot=300; %in seconds %%%% KIMI % % mouseid='104638'; % % list = dir(strcat('W:\npxwaves\MEC\',mouseid)); % % % Parameters % % type_of_unit='good'; % % probe_num=1; % % dt=1; % % thr=2.5; % % chunk_ini=1200; % % chu...
9987e1d90bd36615e2a77941182094715b01ea31fa227d0c6733d37dc79a57a0
MATLAB
5,828
225
% This function centers all projections and superposes them on top % of each other function [H,majorAng,mmRatio,fig] = superposedProjection(obj,RGCidx,showRange) if(~exist('RGCidx') | isempty(RGCidx)) RGCidx = 1:obj.nRGC; allRGC = 1; else allRGC = 0; end if(obj.plotFigures == 0) disp('super...
887e919e5d67edf2bf3db332c4c81d1cb00cf385f10b6355caa57627c85d8ef2
MATLAB
5,829
172
clear all;close all;clc addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final') exp_type = 'encoding' %encoding, tuning_correct reg = 'CA3' lock = 'onset' %onset response ref = 'LM' fs = 500; if strcmp('encoding', exp_type); cond_num=2; titles = {'lure+','lure-...
5a9588c69a060a826afd7f9b9ee2e012ac8ea0dbe7912c720a3ec071908baec1
MATLAB
5,840
145
function mds_peak_decoding(subjects,task,analysis,filetype) %MDS_PEAK_DECODING Create MDS plot from the object decoding data at %peak decoding, and as a video across all timepoints % %Input: subject IDs, task (1=categorization,2=distraction), analysis %('object_decoding' or 'category_decoding'),filetype ('image' or 'vi...
c87729c883b833801f8777c43e797ee84edbcea5f8a62c900e1c5e660f1365d0
MATLAB
5,841
126
function new_link_str = fun_graph_split_node_get_new_link(cc_ind_1, cc_ind_2, node_ind, vessel_mask_dt, vessel_skl, num_voxel_fit) % fun_graph_delete_node_get_new_link find the shortest path that starts at % one point, go through a point and end at the other point. % Input: % midpoint_str: output of fun_graph_delet...
f12fc6c77cb7caa7bcad1abc70e31aed4a466ff9f8c40a7888439b68b3bf7f9f
MATLAB
5,845
218
function [xs, info] = qpwls_bb1(x, A, W, yi, C, varargin) %|function [xs, info] = qpwls_bb1(x, A, W, yi, C, [options]) %| %| quadratic penalized weighted least squares (QPWLS) via %| preconditioned (todo) Barzilai and Borwein gradient method. %| cost(x) = (y-Ax)'W(y-Ax) / 2 + x'C'Cx / 2 %| %| in %| x [np 1] initial ...
20a2128cc05b7ec3aa0ce185e4002a8123253f00bb95fe2053486492903badf7
MATLAB
5,849
172
function[]=ret_vol_stitch_from_AB_window_smoothing(id,datapath) % mosaic parameters id=3*id-2; Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/ThorOCT_code'); addpath('/projectnb/npbssmic/s...
b1cb762be0baf8a268801ff271de5bf93ab767c66f0a60e1d446fa720ecc44d7
MATLAB
5,853
83
% for ploting probability density of spikes % % INPUTS % % A : spikes time courses (time in second dimension) % % OPTIONAL % times : vector with times for spikes ([]) % winP : length of Gaussian window in percentage of range (1) % doploting : if ==1 plots spike PDF % bins : number of bi...
fa31ed9463f126e21e8ba7e6f49836e88918804d42294e96066ad63c84a46612
MATLAB
5,854
137
function nf = fun_graph_get_node_features(cc_ind, vessel_image, vessel_mask_dt, image_size, compute_feature) % fun_graph_get_node_features computes the node features including average % intensity, average radius, center of mass, radial node density % distribution, local neighbor distance and label, nearest neighbor ...
d011bece42072503ca9db0060adac64fab1a62f9398645d1ec58d26c3a9eb3f0
MATLAB
5,856
198
function [out1,out2,out3] = ginput(arg1) %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse (or by using the Arrow Keys on some % systems). Data points ar...
c80a405e8ecfcd04ace567a5a18099c1b78615b122b6a2a10da3a1c40da461d4
MATLAB
5,865
170
function [data]=rdk_scan_preprocessing(data,type) %% realign if strcmp(type,'realign_reslice') for s_=1 for r_=1:size(data.run,2) clear P; clear files; for i=1:size(data.scans,3) files{...
ba68af72eb33b61ecbbc4c3b0ec7c7688fca84465825220d2f29888d39b61edc
MATLAB
5,868
184
%% Frequency of single cell oscillations - All sessions 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\...
b7b0386b9be4595a38d66ac12f4bbf95e77fe6c198105b95152765216665db28
MATLAB
5,870
159
function doRICA(matPath) addpath(genpath('/Volumes/groups/giocomo/export/data/Users/KMasuda/Neuropixels/MalcolmFxn/')); addpath(genpath('/Users/KeiMasuda/Documents/MATLAB/Add-Ons/Functions/gramm (complete data visualization toolbox, ggplot2_R-like)/code')); addpath(genpath('/Volumes/groups/giocomo/export/data/Projects...
bf71f7070991e9e8153e27cfcc79293076acf55bccfd09731fd8b23949df9e47
MATLAB
5,870
159
function rsa_rnn_eeg(subjects,with_stats) %RSA_RNN_EEG Compute and plots the RSA between RNN and EEG with stats, if desired. % %Input: subjects' ID (e.g., 1:13), add stats (1 with, 0 without) % %Author: Agnessa Karapetian, 2021 %% Add paths addpath(genpath('/home/agnek95/SMST/PDM_PILOT_2/ANALYSIS_Full_experiment')); ...
59ee2106f0e98d3f94d8cf1c9a107d22abf0a4b669ce50ee02100b75b6126831
MATLAB
5,874
148
classdef TestTablePicker <handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford ...
bf0231a4ecfc1715e19d736d69d7aed78b972548e67f2925e558da970f06e121
MATLAB
5,875
119
% SPIKE PHASE HISTOGRAM % MH, 2020 % Method to find center of theta sequences by finding the theta phase with max firing rate. For each theta sequence, find active spikes and their % phases, and find at which phase there are more spikes. Then plots histogram of all phases per track and direction, and gives the peak pha...
0cc877d609149c3a5576606fbeeb0c984828429cdf9b11c50e116df7028f0135
MATLAB
5,880
131
clear all;close all;clc subj_list = {'57'} for iSubj = 1:length(subj_list) subj = subj_list{iSubj} exp_type = 'tuning_correct' %encoding, tuning_correct = reg_list = {'HC'} %{'OFC' 'FRO' 'TEMP' 'CING' 'INS' 'EC' 'HC' 'CA3'} lock = 'onset' %onset response ref = '...
58c69d1ffe51c8bbea378c923a0b48b2bf667f9841d2c765b42d29354b2c461c
MATLAB
5,882
178
function D = spm_eeg_tf_rescale(S) % Rescale (avg) spectrogram with nonlinear and/or difference operator % FORMAT [D] = spm_eeg_tf_rescale(S) % % S - input structure (optional) % fields of S: % S.D - MEEG object or filename of M/EEG mat-file % S.method - 'LogR', 'Diff', '...
8dda561b072017b93c93a8d19195cd33283fed76a1fffd0b9f974356efcf118e
MATLAB
5,885
145
function bootstrap_peak_latency_rsa(subjects,conditions_int) %OBSOLETE - use bootstrap_peak_latency_rsa_avg_tps.m instead %BOOTSTRAP_PEAK_LATENCY_RSA Apply bootstrapping to calculate the 95% confidence %interval of peak latency difference (for RSA between RNN and EEG-categorization task). % %Input: subject IDs (e.g., 1...
ad0b5d685c428649dd0dad58e0ca3552af8c80be9b6da8ce33c730b3ed71dab5
MATLAB
5,890
152
function item = cfg_entry(varargin) % This is the entry configuration item class % % Data structure % ============== % Description fields % * name - display name of config item % * tag - tag of the menu item % * val - 1x1 cell array % * check - (optional) function handle to implement configuration % ...
da18451be4bb1cbf23dc141bea3944d4d1318ffd629f2ee686d511458ce4ab3b
MATLAB
5,891
134
function startTime = initMRIChatPart2(mmap, scans2Wait) % Wait for the scanner and return the time the experiment starts. Call this % AFTER initWindow and after initMRIChatPart1. % % The function shows a waiting message, then blocks until the trigger counter % has seen scans2Wait scans, and returns the time stamp of th...
3f7b4e2bcd160205cef70437a2ac5a521207482bfcbc69de860e4680e755230b
MATLAB
5,893
239
%% Figure S8 %% clear ft_defaults %% - SUBJECTS - %% % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OSL31', 'OSL32', 'OSL34', 'OSL35', 'OSL36', 'OSL38', 'OSL39', 'OSL40'}; %% - PATH SETTINGS - %% path_data = '/Vo...
f26577a8e98129ecb21c8fe54bbdc5fdc523d6df4f28a6e32dce3ca535d54284
MATLAB
5,894
151
function plot_Projections(Animal) SavePathName = '/Users/rupesh/Dropbox/AC_Paper/OutlineDarft/Fig_2/Results/PopDecode/SessionWiseData/'; SavePath = [SavePathName(1:31) 'Comments1/Fig_2/Results/Projections/SessionWise/']; %% Get All Projections [IncludeSess] = Get_Sess(Animal); [PassiveProj,ActiveProj] = GetAllSessPro...
a8a45ee5f4b6528799314e5f7fb23fc25d080f2fec90588ffee3a1d4e142f8c5
MATLAB
5,899
191
function [wmap, wconv] = mri_field_map_reg_2d(yi, etime, varargin) %function [wmap, wconv] = mri_field_map_reg_2d(yik, etime, varargin) % % MRI field map estimation using regularization and optimization transfer, % based on a multiple image model: % y_ik = mag_i * phase_ik * decay_ik + noise_ik % phase_ik = exp(1i * w...
de61b04f00af1820ba814b84717d0a5bec5d9f6b64f0d08021e7ba3a17c17864
MATLAB
5,905
137
function [outPatterns,outPatternLengths,outPatternFreq] = IPEMMECExtractPatterns (varargin) % Usage: % [outPatterns,outPatternLenghts,outPatternFreq] = ... % IPEMMECExtractPatterns(inAnalyzedSignal,inSampleFreq,inPeriods,... % inBestPeriodIndices,inAnalysisFreq,... % ...
2878ab384aa4d208fd1bbe606483a20b962f3d7c73cbf7d17382596b9eab569a
MATLAB
5,914
162
% 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 % 2013-01-02...
8e593f53b46ad0ccd35382e9af39b308d9d8ca8375a28f09c433c0e6ba22aaea
MATLAB
5,920
162
% plot behavior clear all; close all; clc patient_num = [39 44 57 63 66 84 85 87] ;%83 %% plot test behav data figure;hold on % plot response distributions and over all accuracy for all patients for subj = 1:length(patient_num) cd(['/mnt/yassamri/iEEG/sandra/subj_' num2str(patient_num(subj))]) load(['b...
cc67800a4c1f2f71115b162597ef99e2227fe54e63f1525fc060a50c1fb8f849
MATLAB
5,926
198
function handles = fix_FixTrackFlies(flies,f0,f1,handles) % track multiple flies % splintered from fixerrorsgui 6/23/12 JAB guidata(handles.figure1,handles); MINPRIOR = .01; se = strel('disk',1); nflies = length(flies); mu0 = zeros(nflies,2); S0 = zeros([2,2,nflies]); priors0 = zeros(1,nflies); for i = 1:nflies, fl...
209bff29351ea46732e20e3773c480d1cfa2b429a99e979fef0201141c1a0c97
MATLAB
5,928
205
function data = spm_eeg_inv_get_vol_sens(D, val, space, gradsource, modality) % Retrieves data for leadfield computation from D.inv structure % Format: % D - @meeg object % val - inversion index (overrides D.val) % space - one of 'MNI-aligned', 'Head', 'Native' (default 'MNI-aligned') % gradsource - 'inv...
f4db3693208312a6eec33f50c0b393e607ee3dbbb0a73fff68198ed259b1edf1
MATLAB
5,929
83
function replay_decoding_split_events_final_lap % Splits each replay event approximately in half, based on when the MUA is % lowest in the middle third of the event. This is used to seperately analyze the % first and second half of long duration replay events % Load parameters parameters = list_of_parameters; load('...
0014b107e5a6fdfd5f1c0e2ae9c4c9f2bfe35f2712b3b95c8a04633385ac3c0a
MATLAB
5,933
223
function [phantom, params] = cuboid_im(ig, params, varargin) %function [phantom, params] = cuboid_im(ig, params, varargin) %| %| generate cuboid phantom image from parameters: %| [x_center y_center z_center x_diameter y_diameter z_diameter %| xy_angle_degrees z_angle_degrees amplitude] %| in %| ig image_geom() %| ...
9f889b4374ad378dc1a48de64ecc48f0a8708000bae7616ca79389dada94bc58
MATLAB
5,933
195
% plots and statistically compares individually saved proboscis data from separate conditions % (data generated with plot_heat_map_proboscis_track and analyseProboscisMotion) clear all close all ylabelText='rel. contacts'; animalInd=5; dataInd=[1 2]; med=0; animalOverlap=1;%put 1 if same animals in b...
071b1b173e7b13ceac7b93f56d8081674ab9190433264b90b7189164ec46c16f
MATLAB
5,935
131
clear all; close all hidden prompt = "Using Existing Experimental Data, Y or N:"; txt = input(prompt,"s"); %Initialization if txt =="Y" prompt = "Enter Destination File Path:"; Destination_path = input(prompt,"s"); while ~exist(Destination_path, 'dir') Destination_path = input("Entered De...
bd89b925261066bc22c975e3bc2622964e0b82b1c1165e8d33cb09b1886a042b
MATLAB
5,945
132
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - Analysi fatta sul dataset a disposizione - PLV - 20 soggetti - Sess. 4 - MEG - Desikan-Killiany % Authors: MCC % Date: 26/10/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear...
d7e678266bfe33328afcff878921ff03e63ad0b0e9f701290aaf6bb9f2e1a8f8
MATLAB
5,945
216
%% Table S1 (PFC) %% clear ft_defaults %% Subjects % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OSL31', 'OSL32', 'OSL34', 'OSL35', 'OSL36', 'OSL38', 'OSL39', 'OSL40'}; %% Paths path_in = '/Volumes/IMPECOG/iEEG_...
6bc71896d901ceee75d9d0b69fdfa115c18e3dc4cff911ff3e082794c375413e
MATLAB
5,946
230
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% 4-level multiresulution nonrigid image registration with no constraint %% Conjugate gradient with Newton's first step was used %% Cubic B-spline bases are used for both image and deformation models %% %% Copyright July 2007, Se Youn...
4015473b73f20bdaf39cec40df2c4e60b534db7c6cb192371600120b171d50ff
MATLAB
5,947
183
function [ umapOrEppOrMatch, reduction, clusterIdentifiers, extras]=... suh_pipelines(csvFileOrData, varargin) %SUH_PIPELINES brokers ALL input and output argument of either run_umap or % run_epp or SuhMatch.Run depending on the named argument 'pipeline' % which defaults to 'umap'. % For usage of UMAP, see u...
cbbf9935ee2d55f1fc858159ecc93373682d8a585a30d898d66f73f9972ac8c6
MATLAB
5,952
103
%% PRJ_Error BIDS Conversion: CP24 % Convert CP24 data from original CWH to BIDS directory format SBJ = 'CP24'; % Set Up Directories 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/fieldtri...
dacb1a676c084a5f8f3530c55b71fd74806c06fd996c61d71c682179cd17afb1
MATLAB
5,954
119
%% IR84 Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if isempty(strfind(path,'fieldtrip')); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = 'IR84'; SBJ_vars.raw_file = {'IR84_erro...
935db31de7c6ad43ce29817762e964698091b9a9162eb6da4a884dfb899edb20
MATLAB
5,957
148
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % "Batch" code to compute PWelch & PLV after spatial downsampling - 20 subjects - MEG & DK only % Authors: MCC % Date: 25/10/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clc; %% to be a...
1db5c909d238cd5e084d70a848c9024e15a992eced54a23d1c88adbd8ac63049
MATLAB
5,959
159
function Fmenu = spm_Menu(action, varargin) % SPM Menu window % FORMAT Fmenu = spm_Menu('Create',Vis) % Create the SPM Menu window (tag property set to 'Menu') % Vis - visibility: {'on'} or 'off' % Fmenu - handle of figure created % % FORMAT Fmenu = spm_Menu('Switch',Modality) % Switch the SPM Menu window to the sp...
5544d7a36c90f2ea6f8794db8c26babec5c134021ff893020f1d0259cb7e165b
MATLAB
5,959
90
% THETA SEQUENCE DECODING ERRROR % MH, 2020 % Finds real position at the time of the theta sequence, and calculates the decoding error during the theta sequence % INPUTS: % decoded_thetaSeq - uses decoded theta sequences that have passed velocity and number of active units thresholds. % If em...
2a72d5c09967d05468b632013146f05943e8ea512e47d11d4f9b853abcb9b67e
MATLAB
5,960
217
%% Stacked Single Trials Motor Cortex %% clear ft_defaults %% Subjects % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OSL31', 'OSL32', 'OSL34', 'OSL35', 'OSL36', 'OSL38', 'OSL39', 'OSL40'}; %% Paths path_in = '/V...
a85f8c381166c576051b6bed2428066a0ed8da785420c5a444ba82907c4da7d5
MATLAB
5,960
115
function scored_replay = replay_scoring(data,analysis_type) % Runs up to 4 scoring methods for candidate replay events: line fitting, weighted correlation, path finding (or pacman), and spearman correlation coefficient. % Modify_decoding.m subroutine is run to zero probability if no spikes from good place fields occur...
045c6400b50d8860c0b17951cc45b9ef05f7671efad826a137d6c99c9222122a
MATLAB
5,966
126
function new_link_str = fun_graph_split_node_get_new_link(cc_ind_1, cc_ind_2, node_ind, vessel_mask_dt, vessel_skl, num_voxel_fit) % fun_graph_delete_node_get_new_link find the shortest path that starts at % one point, go through a point and end at the other point. % Input: % midpoint_str: output of fun_graph_d...
8947316ba93a779d9eaec5b530672ce25c20f4a9ee1a201951f32f20d4ef8c81
MATLAB
5,970
129
function IPEMBatchExtractSoundFragment(varargin) % Usage: % IPEMBatchExtractSoundFragment(inFragment,inInputDirectory,inFilePattern,... % inOutputDirectory,inNewNameFormat,... % inCreateDir,inFadeInOutTime,... % inPre...
fdb4d86a7c0135e98838693426c98d37e0538cb1392e395b096e9c36d17e3dd8
MATLAB
5,973
136
% This script warns the user that something went wrong in a program. % It should be called from a catch-statement, where it saves all % workspace variables (so no data is lost), shows an error msgbox and % rethrows the original error. % % The workspace is saved to ErrorTermination_YYYYmmDDHHMMSS.mat in the % working di...
b8ee32e2bde0a221c6e39349541aa5783a6ade19d5981c3e2b1a1c1ad49b79f8
MATLAB
5,980
229
clear; %{ This script sweeps through bound and lambda values and saves psychometric paramaters (conditioned and unconditioned) Can be easily configured to run free/choice interrogation tasks Can be easily configured to run for continuous or discrete stimuli Can be configured to change the drift instead of initial po...
a58f082e1d62b7a19f9af605b64bbb88ed17526a6afb3c1c4823d07f921ec0ba
MATLAB
5,988
231
function sh = de_ftab_s_iter(fit, fh, varargin) %|function sh = de_ftab_s_iter(fit, fh, [options]) %| estimate s from fh by iterative LS %| sh = argmin{s} | fh - fm(s) |^2 %| in %| fit from de_ftab_fit() / de_ftab_curv() %| fh [(Nd) M] estimates of f (nonlinear BH function) %| option %| 'niter' # of iterations (d...
0ca74a3ad6c50595185b16dffd866bec186f38a52a4ffaf95b8fb6827de96987
MATLAB
5,990
180
cond1a = cell(1,length(group)); cond2a = cell(1,length(group)); cond3a = cell(1,length(group)); cond4a = cell(1,length(group)); cond1a_null = cell(1,length(group)); cond2a_null = cell(1,length(group)); cond3a_null = cell(1,length(group)); cond4a_null = cell(1,length(group)); cond2a_pacz = cell(1,...
cad59122c797dede91bdd8f65e0d0a32e195cdc95e31fdb3dd886b5e9578c173
MATLAB
5,992
143
clear all; close all;clc subj_chan_name = cell(1600,1); X = nan(1600,1); Y = nan(1600,1); Z = nan(1600,1); anat_selec_index_group = nan(1600,1); cue_resp_index_group = nan(1600,1); subj_list = {'39' '44' '57' '63' '66' '84' '85' '87'}; addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final') i=0 for iSubj = 1:l...
d11dbbbebd403bee846918a177f16b9a94d1d5d849effee47725b0b9ef6a066d
MATLAB
5,992
176
% Plot Firing Rates of Cells addpath(genpath('/Volumes/groups/giocomo/export/data/Users/KMasuda/Neuropixels/MalcolmFxn/')); addpath(genpath('/Users/KeiMasuda/Documents/MATLAB/Add-Ons/Functions/gramm (complete data visualization toolbox, ggplot2_R-like)/code')); %% % sessions = dir('/Volumes/groups/giocomo/export/data...
ba666032631bb38b5f0fec55c6d2715c4d823fd933800af2f0d64321592ccd2b
MATLAB
5,995
126
function [df_leaving_all,df_entering_all,f_leaving_all,f_entering_all,... kinematics_leaving,kinematics_entering,kinematics_leaving_std,kinematics_entering_std] = ... getDf_aligned_kinematics(f_orco,thresh,delay,yl,type,singleTrial,plotFig) %getDf_aligned_kinematics calculates the firing rate, change in firing...
e3d56c9adb285ac887aa6efa1c1fc1b07b97fc9293b016a26d7b8803212b22ca
MATLAB
5,996
133
%% Plot preprocessed data for cleaning with Bob % 1) Load preproc data (downsample, highpass, trim, notch) % 2) Plot data to identify bad channels and epochs clear all; %close all; %addpath(genpath('/home/knight/hoycw/PRJ_Stroop/scripts/_TOOLBOXES/')); addpath('/home/knight/hoycw/Apps/fieldtrip/fieldtrip/'); ft_de...
ef7c7724cdae61a3082869be840e1870413a89f20044bf47720918a6af4e1a05
MATLAB
5,998
228
function [x, mask0] = mri_phase_denoise(yi, varargin) %function [x, mask0] = mri_phase_denoise(yi, [options]) <- recommended usage %|function [x] = mri_phase_denoise(yi, l2b, niter, chat, wthresh) <- old way %| %| in %| yi [(N)] noisy complex image: y = mag .* exp(1i * x) %| can be any size: 1D, 2D, 3D, ... %| %| op...
a8ebe5c4150cb4bb0437eec7b017f3bb6843facc4526a2391d89b7552a4247ef
MATLAB
5,999
133
function xk = modelStepMultiMealT1D(xkm1,I,CHOB,CHOL,CHOD,CHOS,CHOH,hourOfTheDay,mP,xk,model) % function modelStepMultiMealT1D(xkm1,I,CHOB,CHOL,CHOD,CHOS,CHOH,hourOfTheDay,mP,xk,model) % Simulates a step of the multi-meal t1d physiological model. % % Inputs: % - xkm1: is a vector containing the model state at time k...
fd8adb9b0a2c6bac9f190542af5ecc5059e5f66b1b385bfeb87b0dfbdefff7aa
MATLAB
6,001
225
% this script first generates fake psychometric data with lapse rate, number of trials, range and discretization of diifficulties. % then it fits a psychometric curve and reports the lapse rate % it also estimates the lapse rate based on the end point at the highest trial difficulty % and then reports how good the reco...
e8c9b09921019ae33a7de3bfb42d0c6d6640e3c680255836b612931cfebfb56a
MATLAB
6,005
160
function BHV02d_RL_model_plot_grp_predictions(SBJ_id,proc_id,model_id,plt_id,save_fig,varargin) %% Plot model predictors across group averaged within condition % INPUTS: % SBJs [cell array] - ID list of subjects to run % proc_id [str] - ID of preprocessing pipeline % model_id [str] - ID of the model parameters to...