sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
80a597b482cb19080e86d6d6fc338afe7515c1bc290b006aad997ebd50a75cc5
MATLAB
3,704
60
in scanfiles: % figure(979); clf; plot(tt,PSTHs); title('PSTHs'); xlim([-10 30]); %set(gca,'yscale','log'); % figure(978); clf; plot(tt,PSTHZs); title('PSTHZs'); xlim([-10 30]); %set(gca,'yscale','log'); % figure(977); clf; plot(tt,PSTHZsPOm); title('PSTHZsPOm'); xlim([-10 30]); %set(gca,'yscale','log'); % figure(9...
0ea3860cad5443f415f7cb033ace9cd2e7c22c8313a4b9a8066f04abc70681d5
MATLAB
3,706
100
function cfg_artifacts=st_artifact_reject_grid(cfg_artifacts) % ST_ARTIFACT_REJECT_GRID determines a rejection grid (i.e. segments to fully reject) % % Reject segment when proportion of artifactual chans >= segmentrejectthresh % Lower values are more aggressive (a few artifactual channels will label a segment for...
e837956bb3179eac9afd631dc886ba85fe4faa17c30013a7b249727fadaf1a2a
MATLAB
3,707
104
function subj_Variance_response_LCMV(sn) % source reconstruct post-response beta variability increase load('subs.mat'); subname = subs.name{sn}; set_name = fullfile(Dir.prepro,[subname,'_clean.set']); EEG = pop_loadset('filename',set_name); EEG = pop_select(EEG,'nochannel',{'LHEOG','RHEOG','BVEOG','TVEOG'}); ...
6c7fd34fdb58e844b6816ec168e0945447b8cb44e2f63cbc2592d58049de53ac
MATLAB
3,713
82
function mltp_slice_fnvt_to_slice_can_movement(obj, session) % This function calculates the movement in cm/s for each trial. We need % to store this because when we map a rectangle to a square for the 90 % degree correlations the spike maps has a minimum speed threshold, % which should come from the tru...
811ac95d7d70f7b842e1261507c4ae83b3eb134577680141502687a8b0e7ce29
MATLAB
3,713
120
clear all close all clc %%%%%%%%%%% ADDPATH TO EXCEL FILE addpath('J:\Carlo\CarloKaizhen\CC110-0513\KaizhenSelected') %%%%%%%%%% READ EXCEL FILE read_name='CC110_0513_Ymaze_traces_20Hz.xlsx'; data=xlsread(read_name) data_zscore=zscore(data,1,1) %%%num_cells=length(data_zscore(1,:)) num_cells=length(data(1,...
6ad2e70304da88d28ea5d835cb72be2d8a000c5224d2d8eaacef6521d651b3f3
MATLAB
3,714
93
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [averageCorrelations, totalSamples, numCells, numSamplesExcluded, animalSessionCellIds, animalSessionCellNames] = compute_bfo180_similarity_using_percell_table(PerCell180, fieldNamesWanted, BFO180_MIN_MAPS) BFO180_MIN_CO...
cc58abd971e5b418fd5b1c14d270bd69c4ae3ed8b978e44e1ec2d2f82ab88395
MATLAB
3,714
117
function ml_two_contexts_plot_averaged_combined_orientation(pc, contexts) % contexts must be "all" or "within" % This code make the orientation plot averaged across days % Load the project settings if not already loaded if isempty(pc) pcFilename = fullfile(pwd, 'project_config.json'); if ~isfile(pcFilename) ...
7c0f0fe9d9bad2bb32aeb13a213bcfb7cadf798be06826833afbec2b51fd1cf2
MATLAB
3,715
76
function subject_FD_parse_v2_octave(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm,output_dir) % Code from OHSU Fair Neuroimaging Lab % Written (2014) and commented (9/8/2015) by Eric Earl % % FD parsing Nipype wrapper pulling in list of motion files % % Modified to read (and ignore) DVAR_pre_reg, DVAR_post...
77e071b08239bba3dd01de25cdb5d5f204c0e0f8611808b1053c79ee0b50f834
MATLAB
3,717
76
function subject_DVAR_parse_v2_octave(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm,output_dir) % Code from OHSU Fair Neuroimaging Lab % Written (2014) and commented (9/8/2015) by Eric Earl % % FD parsing Nipype wrapper pulling in list of motion files % % Modified to read (and ignore) DVAR_pre_reg, DVAR_po...
88f7648f13237f3947421943309a3f917fc2e294df07530454f60db0af85d04d
MATLAB
3,717
117
%{ For the specified k and cognitive variable, extract the frequency, transition distance, and idiosyncrasy p-values. FDR-correct to generate new p-values and threshold correlations with them. Output: pcorr.csv Original p-values from all metrics in one table. pcorr_fullfdr.csv FDR-corrected p-values from all metrics in...
d6e9d313a1ea51548b150f79b8a57c80f7b0dd15782ee37768210d583e7b9731
MATLAB
3,720
116
function neighbours=st_get_minimum_neighbours(cfg) % ST_GET_MINIMUM_NEIGHBOURS creates a neighborhood structure such that each channel has at least a specified number of neighbors. % % Use as: % neighbours=st_get_minimum_neighbors(cfg) % % Required configuration parameters: % cfg.elec = FieldTrip ...
a589709e86123097df6b154a455e8d21bf47f33c9e71b5066639241f2f863a88
MATLAB
3,723
91
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [F, success] = ml_alg_compute_best_aligned_map_table_v3(T, comparisonMethod, REFLECT_ONE_CONTEXT) F = []; success = true; wb = []; % Get unique animalName, sessionName, cellName combinations R = get_...
8b42a78f0c876841441e4d0979c0f3f205dfa7918e6b0cc417079ba0d80b926c
MATLAB
3,725
93
function [boxes, blobIndIm, blobBoxes, hierarchy, priority] =... Image2HierarchicalGrouping(im, sigma, k, minSize, colourType, functionHandles) % function [boxes blobIndIm blobBoxes hierarchy] = Image2HierarchicalGrouping % (im, sigma, k, minSize, colourType, functionHandles) % % Create...
b90f017139f1edc9acc9640e302eca942b35b2ee92cc7197b70fd3fb256a8b5e
MATLAB
3,725
74
%% RUSH configuration vol_params.vol_sz = [600,600,150]; % Volume size to sample (in microns) vol_params.vol_depth = 50; % Set the depth of imaging (depth at the middle of the simulated volume) vol_params.neur_density = 3e4; pixel_size = 0.8; % pixel size of your system vol_params.vres = 1; % ...
b3fe3bd1f6f9b849e78171dbb67f814285bc503b36f8f74360a54c95921e504f
MATLAB
3,726
90
classdef diffusion_mapping_tests < matlab.unittest.TestCase % Regression tests for matlab/analysis_code/diffusion_mapping.m % Covers issues #98 (complex eigenvalues) and #94 (sqrt(N) component cap). methods(Test) function test_real_eigenvalues_on_cosine_similarity(testCase) % Issue #98:...
7e05e5cc6c17a738c9ea9aed561d014e04968ef24c07aba860066d9d6aa1a66d
MATLAB
3,727
103
%aLFP %plot xcorr btwn meanLFP (mean over all elecs)and motion variables % odd/even by movie %clear all; %close all; if ~exist('rrr'), rrr=0; end; rrr=rrr+1; [user sys]=memory; MALAB_used_mem(rrr) = user.MemUsedMATLAB/10^6; %in MB fprintf(1,'available memory: %.0f matlab used: %.0f MB rrr=%d\n',sys.Physical...
b8de103cc8637177f3306730cfe31d934f7d84ace3a95d15248f4fb0cba0aa43
MATLAB
3,727
117
function [proj] = elproj(pos, method) % ELPROJ makes a azimuthal projection of a 3D electrode cloud % on a plane tangent to the sphere fitted through the electrodes % the projection is along the z-axis % % [proj] = elproj([x, y, z], 'method'); % % Method should be one of these: % 'gnomic' % 'stereographic' ...
c4857b5336a2825b2125d0f87019febaed3ed0fa1ec7a3d82806d347c2c8c4b6
MATLAB
3,728
119
%% estimate the PDF with 2^4 to 2^10, calculate frechet distance, and compare %% para path = pwd; Modal = {'DBM','VBM'}; Type = {'smooth','nosmooth'}; NP = 2.^(4:10); roi_num = 48; sub_num = 444; Fre_dis = struct; Fre_dis1 = struct; results = struct; results1 = struct; %% PDF for itype = 1:length(Type) for imoda...
f921a8db27f2367bbb5e466e550d263a99d319336a20d4e44b7c32a00a20617b
MATLAB
3,729
124
% run_simulations_highFR_stdRP.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../simulate'; }; addp...
1a5fd4ec2c203d6a70acc477303eed6209b447cd3858d1b973d7c263c7eb9863
MATLAB
3,734
124
function[data,h]=SONGetMarkerChannel(fid, chan, varargin) % SONGETMARKERCHANNEL reads a marker channel from a SON file. % % [data{, h}]=SONGETMARKER(FID, CHAN) % FID is the MATLAB file handle and CHAN is the channel number (1 to Max) % DATA is a structure containing: % DATA.TIMINGS: a length n vector with the marker ...
0e16fb597b8f80f3087b78c0bb9d145cd379f4384cf854eca7534fd3aae60383
MATLAB
3,735
85
function [Best_HiddenMarkoModels, info] = HiddenMarkovModel_val_cross(HiddenMarkovModels, emision_sequence_cross, info,str_save_append) %% Validate and select the best Hidden Markov Models (HMMs) using cross-validation. %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % - HiddenMarkovModels: ...
8e8828bea4f621293c9272ddff20bbe3b6b9f99a7c4e91cd785cd4078a660186
MATLAB
3,736
96
% mglCreateTexture.m % % $Id$ % usage: [texture, results] = mglCreateTexture(image) % by: justin gardner % date: 04/10/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Create a texture for display on the screen. % Image should be m x n x 4...
93b6e91ce305a78233f9de7abacb0527d22f3f62257a02a5918951d884a4274c
MATLAB
3,737
43
mouse: 'Thalamus39' %Name of mouse date: '20160401' %Date of experiment session: 'Emergence' %Recording session movie: '40' %Movie within session nucleus: 'POm' %Nucleus expressing ChR2 whiskers: 'W' %If mouse has whiskers(W) or trimmed whiskers (nW) CSCs: [1 2 3 4 5 6 7 10 11 12 13 14 15 16] %CSCs that have good...
28fb80a9244f7f8ed615eb22e3e1a1d80e71b121224a33fe24b81cca43d7ca25
MATLAB
3,738
106
% ********** Setup the directory on your computer ********** clear restoredefaultpath filePath = matlab.desktop.editor.getActiveFilename; root0 = fileparts(filePath); addpath(genpath(fullfile(root0,'lib'))); root = fullfile(root0,'data'); projname = 'sphere_1'; %% Read simulation result files = dir(fullfile(root,proj...
b5f30ffc1bc58b783370c57004ba48c7fedfcd8f6b83bfdec5eaf33528eacab0
MATLAB
3,738
86
addpath(genpath('.')) %% % name of the videos list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; num_Exp = length(list_Exp_ID); % avg_radius = 10; % original_masks avg_radius = 9; % added_refined_masks lam = 15; r_bg_ratio = 3; % r_bg_ext = li...
166bdce002ddb2072dd43a12d243b82623ff8b61fbd149c6a3f36811523840b9
MATLAB
3,740
102
function [dat] = read_nex_data(filename, hdr, begsample, endsample, chanindx) % READ_NEX_DATA for Plexon *.nex file % % Use as % [dat] = read_nex_data(filename, hdr, begsample, endsample, chanindx) % % See also READ_NEX_HEADER, READ_NEX_EVENT % Copyright (C) 2007, Robert Oostenveld % % This file is part of FieldTri...
7c9b5323a0449d4338b581b2dca4c1eb7b522dd96f0aa9b58f2ceeadc8ca6d07
MATLAB
3,741
73
% Parameters setting template % ----------------------- Parameters set in GUI or script ------------------------ % parameters don't need to change handles.Params.saveOutput = 1; % default handles.Params.LapPhaseCorrection = 0; % default % Method Dictionary handles.Param...
837d842130e9bd7a4a08b7ad1ee66c862d51d5bf767e33ce77a5682a3d6e07de
MATLAB
3,742
104
function [] = ExtDataFig03_BidirRespMod_Normalized() % Code for plotting the mean change in ΔF/F after song-type transitions relative to ΔF/F before the transitions in Extended Data Fig. 3e,l. GT = 'dPR1TN1SG'; switch GT case 'dPR1TN1SG' ylimrange1 = [-.3 .6]; ylimrange2 = [-.3 .6]; end %% parame...
d7746ccda768f541de601081e7daab188b89e9451cf782b7fef07e4c84931f0e
MATLAB
3,742
96
% getCorrCoeffBehContParam_cond_all.m % % Function that gets all pairwise correlation coefficients for all input % continuous behavioral parameters, across all flies (specified as list of % pData file names). % Calls getCorrCoeffBehContParam_cond_fly() % % INPUTS: % allBehParams - array of structs for behavioral pa...
b1d3cc772d2b59a7ced010838beac05ab0ff7883684b64f0596856a6e4c788e5
MATLAB
3,745
92
function data = TDMS_readFileHelper_v2(fid,optionStruct,metaStruct,paramsStruct) %TDMS_readFileHelper_v2 % % SECONDS_IN_DAY = paramsStruct.SECONDS_IN_DAY; CONV_FACTOR = paramsStruct.CONV_FACTOR; UTC_DIFF = paramsStruct.UTC_DIFF; STRING_ENCODING = paramsStruct.STRING_ENCODING; %INPUT UNPACKING %===========...
fb163c26e17dbcf8c2ed8189625564cfce6df61a5606583bb0f0c19c0ef32fef
MATLAB
3,745
144
%Number of Model Iterations iterations = 10000; %Number of Mosquito Intervals interv = [1:10]; mcount = [21:30]; %Capture PIs SimulationOutputPI = nan(iterations,max(interv)); SimulationOutputHSR = nan(iterations,max(interv)); %Define Zones X = [98.88;564.69;564.69;101.46;701.46;1157.59;1156.95;701.46]; Y = [68.55;69....
42505d5cf603ea7ba693c5cc789a2a7b1d1f1fb9f4cc7cbf2ee5c09a38c6f36b
MATLAB
3,746
106
function mvar = ft_datatype_mvar(mvar, varargin) % FT_DATATYPE_MVAR describes the FieldTrip MATLAB structure for mvar data % % The mvar datatype represents multivariate model estimates in the time- or % in the frequency-domain. This is usually obtained from FT_MVARANALYSIS, % optionally in combination with FT_FREQANAL...
d5e0a8c56744de31eceb2be1a67906d65ae2d6a53022703cd61ff93d89f15442
MATLAB
3,752
88
% DERIVATIVE5 - 7-Tap 1st and 2nd discrete derivatives % % This function computes 1st and 2nd derivatives of an image using the 7-tap % coefficients given by Farid and Simoncelli. The results are significantly % more accurate than MATLAB's GRADIENT function on edges that are at angles % other than vertical or horizont...
218b6e316f9f8fd2dfc2485c5a64338fc8a05e4e2306c81ae1dd305b0b26a04a
MATLAB
3,753
127
function [mnv,mxv] = spm_minmax(g) % Compute a suitable range of intensities for VBM preprocessing stuff % FORMAT [mnv,mxv] = spm_minmax(g) % g - array of data % mnv - minimum value % mxv - maximum value % % A MOG with two Gaussians is fitted to the intensities. The lower % Gaussian is assumed to represent backgr...
36c135c060494ef32c25f84b5037f273a373d9fbc72a7dac0debf37d87d1ee95
MATLAB
3,753
127
% plotOptoFicTrac_allFlies.m % % Function that takes output files from extractFicTracOpto_fly() and % generates a plot of the specified FicTrac param. Plots % mean for each fly as well as across flies. User selects one dur, one ND, % one FicTrac parameter, and whether to plot raw values or change in the % paramete...
4173e5072e61f64561d49ea78a87d35680320caa92c803b286b7aa1f4fb6d2a8
MATLAB
3,760
98
%% fast slow trial,neron reponse on set clear close all file=dir('ACC*reverse*.mat'); earlylick=[]; latelick=[]; k1=1;k2=1; for jj=1:length(file) load(file(jj).name) totalevent=sort([Events.C1S3;Events.C1S5]); fa=find(outcome(:,1)==4); for i=1:length(fa) cuetime=totalevent(fa(i),1...
1cbed400f72612b0952eca3e01c6f0916330da86b488a774971a63aca512b39b
MATLAB
3,762
144
function[data,header]=SONGetChannel(fid, chan, varargin) % SONGETCHANNEL provides a gateway to the individual channel read functions. % % [DATA{, HEADER}]=SONGETCHANNEL(FID, CHAN{, OPTIONS}); % where: % FID is the matlab file handle % CHAN is the channel number to read (1 to Max) % OPTIONS if pr...
43c6ca00fc7c94adb9e4ddaa0b52847f2da63745e900bddf35762c25b5d1a603
MATLAB
3,763
108
function results = vl_test_pr(varargin) % VL_TEST_PR vl_test_init ; function s = setup() s.scores0 = [5 4 3 2 1] ; s.scores1 = [5 3 4 2 1] ; s.labels = [1 1 -1 -1 -1] ; function test_perfect_tptn(s) [rc,pr] = vl_pr(s.labels,s.scores0) ; vl_assert_almost_equal(pr, [1 1/1 2/2 2/3 2/4 2/5]) ; vl_assert_almost_equal(rc, ...
632342a11a46475f494e27ce2d1d97e3660f9dea9b7e9c072aa5ad81f3909546
MATLAB
3,763
112
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This is the main script (for tetrodes) to compute the data tables we need to perform the % further analysis. close all clear all clc run('../figure_scripts/load_figure_config.m') addpath(genpath('.')); tstart = tic; dateTag =...
9b0b4bf48ce0a3bb6dfd42f6d16105625fd242aeec194a42c11a80f0bc6dca9e
MATLAB
3,764
116
function [unwrappedPhase, PhaseLaplacian] = phase_unwrap_laplacian_2D(dataPhase, Params, RefVox, zp, padsize) % [unwrappedPhase, PhaseLaplacian] = phase_unwrap_laplacian_2D(dataPhase, Params, RefVox, zp, padsize) %================================ % HEADER %================================ % % Name: phase_...
0f0c8dba1b5683332dc6a18b5f3b0f851710272d1740346ff235e1194521315e
MATLAB
3,767
127
% plotIInjFicTrac_allFlies.m % % Function that takes output files from extractFicTracIInj_fly() and % generates a plot of the specified FicTrac param. Plots % mean for each fly as well as across flies. User selects one dur, one ND, % one FicTrac parameter, and whether to plot raw values or change in the % paramete...
f4b80ff98ddf5bca47d61850a4639544bad67d1b6bb9d70640c543c160f407c6
MATLAB
3,767
141
% xcorrWGaps.m % % Function to compute cross-correlation when there are non-random gaps in % the data. % Operates on 2 input vectors. Gaps in vectors should be NaNs. Input % vectors must have same sampling rate. % Uses corr function to calculate Pierson's correlation for each lag, after % removing missing data point...
fbb3a5d8623e077027ddd7e7b2f7efebe0dac79e9a72ec7514d252b32bcd5782
MATLAB
3,767
75
% Get header of the system information % [ Yokogawa MEG Reader toolbox for MATLAB ] % % brief: % This function retrieves information about channel in the specified file. % % usage: % channel_info = getYkgwHdrChannel(filepath) % % arguments: % filepath : file path % % return values: % channel_info ...
0397419767f60486dae8a05ccc28e82bf3efa6efafc28feb0f9a7271ce2646d6
MATLAB
3,769
131
function [] = ExtDataFig05_pIP10_AveTimeCourse_OptStim_Neuron() % Code for plotting the time course of ΔF/F recorded from dPR1 and TN1A in Extended Data Fig. 5g. GT = 'TN1dsx'; %% parameters nTrials = 3; nStim = 6; T = 1370; % T FlightTrialThre = 3; PreEventImg = 72; % 10 s (71.0443) OneTrialDur = 214; % 30 s (213....
bb27c7273c2bad856a78e367ec87060e844c409dad0f49822e87e25fae519af3
MATLAB
3,769
110
<<<<<<< HEAD function [ims, imsTime, imsTime_n] = createIMS(result_f, key_f, general) % Calculate IMS imsTime_n = 0; imsTime = 0; oldID = -1; oldID_id = -1; i_r = 0; % Only for matching_function == 'library'. % I load the library for better performance if strcmp(general.MATCHING_function, 'library') == 1 loadlibra...
d17348c5c2a76b31f409d2800e5debfefa51aecb07f099ddc82ec3e17ab25a87
MATLAB
3,769
101
% function fig3_source_to_xlsx(means, sems, x, pos_true, neg_true, ... % source_data_fname, sheet_name) % % wrote this in an effort to fit data for all figures into one excel file % with one sheet per figure. this is the fig 3 part. % means is a cell wth a 2-row-array for each panel. same with sems. x just % has on...
627828ad4aa0fba608298f0711e29b03e8dc0850adca5c544e7397214235ac6d
MATLAB
3,770
127
% f_DesignIIRfilter.m % % Copyright (C) 2015, Miguel Navarrete % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any la...
2ad8587d80db1b80f43f227b7f1b9c7b28c072b49ea6097acef6a54dfff05291
MATLAB
3,771
111
function this = gifti(varargin) % GIfTI Geometry file format class % Geometry format under the Neuroimaging Informatics Technology Initiative % (NIfTI): % http://www.nitrc.org/projects/gifti/ % http://nifti.nimh.nih.gov/ %_____________________________________________________________...
5b01fa039a2c7915ddedb2cc7be4e9c00aa324226053c658496220abc3cb4348
MATLAB
3,771
100
function [success, errorString] = IBEI_calcIBEILogHist(startFolder, outputFolder, param) trialFiles = dirr(startFolder); numTrials = length(trialFiles); trialFilenames = {trialFiles.name}; idxUnderscore = strfind(trialFilenames,'_'); idxDot = strfind(trialFilenames,'.'); phaseNames = []; c = 0; for hh = 1:numTrials %...
9aaeed7980f1114173c2466785dacc631f5df40a11c2b9e9af361db45abcc72f
MATLAB
3,771
84
% dir_method = 'CNMFE'; save_date = '20221221'; % dir_method = 'min1pipe'; save_date = '20230111'; addpath(genpath('.')) %% % name of the videos list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; num_Exp = length(list_Exp_ID); % dir_parent=fu...
8f929e76645f23f874a796278268be5607e6f5e4be2992969623e0b5bfd67e70
MATLAB
3,772
92
function varargout = corrTimeAndSpace(t1,t2,s1,s2,varargin) % varargout = corrTimeAndSpace(t1,t2,s1,s2,varargin) % % Correlate two decompositions using both the timecourses (t1 and t2) and % spatial profiles (s1 and s2). % % 2018 - Adam Charles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
26514708854da6d44e5bdf1f80559d9f243cb09a84aaf9d3185a3cff9f278496
MATLAB
3,774
107
classdef rpgdegibbs_s < handle properties (GetAccess = public, SetAccess = private) end methods (Access = public) function this = rpgdegibbs_s() end function imgdg = degibbs(this,img, dim, pf, params) if nargin <= 4 ...
9ed45c40a63da5314bd68724d3515657f7fca684e35a5b9f8724518ae4435436
MATLAB
3,774
108
% fictracImg.m % % Experimental Function % For simultaneous acquisition of FicTrac and 2P imaging data % % INPUTS: % settings - struct of settings from twoPhotonSettings() % flyData - fly metadata from getFlyMetadata() % exptDuration - duration of experiment, in seconds % % OUTPUTS: % exptReturn - returns 1 upo...
cb2e5a0708652ab4706301a4a6f2f73dd5f75f6ad45a3fd75cf0ba56834381f7
MATLAB
3,774
112
function [intensities,intensities2, red_locs, s2p_median, red_cell_ids,s2p_centroids,red_ids] = findintensities_all_s2p_mask(red_wavelength_stack,Fall,redcells) % FINDINTENSITIES_ALL_S2P_MASK uses suite2p mask outputs. Returns intensities for each red selected cell % across pockels and wavelenths; also returns the loca...
0ccd2063160c3fbe107714a312a982dc7db8413043888b6a080bc82d210b8b14
MATLAB
3,775
104
function P_map = TFI_autofit(D_map, chi_est, R2starMap, maskErode, mask_LBV) % P_map = TFI_autofit(D_map, chi_est, R2starMap, maskErode, mask_LBV) %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Purpose: % fit the TFI P_map functino parameters, i.e. sigma0 ,r0, sigma1, sigma...
886c93d1d6d8b1121af41130fff9b1e5752d974e0e1d735ffda6ff5162e71cc2
MATLAB
3,775
119
%% tdt2mat.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Import data from TDT system recording into Matlab structure % % S = tdt2mat(filepath, tank, blk, event) % % INPUTS % filepath: folder where tank is stored % tank: tank name % blk: block name % event: event name (ie 'Wave') % % OUTPUT % data structure with...
1f9a91ad531cfbe1d47882db343fc07bcfb728b73d27409ce5aad0409d80ab15
MATLAB
3,777
122
function [magn] = read_ctf_sens(filename); % READ_CTF_SENS reads MEG sensor information from CTF configuration file % % magn = read_ctf_sens(filename) % % where the returned structure meg has the fields % magn.pnt position first coil % magn.ori orientation first coil % magn.pnt2 position second coil % ...
6e4cc04308ff6e8341ccfb9131dbf2c9c855fb4edfeacb65b5eda2fea9101f0c
MATLAB
3,778
87
% "Wire coil creator" tool for the entire coil. Models the outer surface % of coil windings by multiple wire segments. The output is saved in the % binary file coil.mat and includes: % Pwire{:, 3} - set of nodes for all wires % Ewire{:, 2} - set of edges/segments for all wires (current flows from the fir...
07fc1ac93bf223381c52240d4a4429ddd0de343686da565912523b29581858f3
MATLAB
3,779
62
function neur_params = check_neur_params(neur_params) % neur_params = check_neur_params(neur_params) % % This function checks the elements of the struct neur_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - neur_params - Struct cont...
66b785cd3aa981bb9cfcf75ec6d5e3d65f83f17f2a15d1bd44a6f5c14fce9912
MATLAB
3,780
135
vid = VideoReader(vidName) addpath(YourPath) %generate mode background model ModeBackgroundModel %% detecting hblob = vision.BlobAnalysis(... 'CentroidOutputPort', true, ... 'AreaOutputPort', true, ... 'BoundingBoxOutputPort', true, ... 'MinimumBlobAreaSource', 'Property',... 'MajorAxisLengthOutpu...
8bd6cb0b326c98aaa9a3c93d9f484144c71b20690f2350171a0f2e4a5eab56c2
MATLAB
3,780
172
function [chm, snrk] = modkurt(ch,k,p); % Modify the kurtosis in one step, by moving in gradient direction until % reaching the desired kurtosis value. % It does not affect the mean nor the variance, but it affects the skewness. % This operation is not an orthogonal projection, but the projection angle is % near pi/2...
62f5b007b8a95c88b2dd71a40b8c3733358a39482596c555e0a7affdda1d8ef2
MATLAB
3,782
120
% run_simulations_pbase_vary.m % to generate a new set of % 144 x 100 simulations % (# param combos x # iter) % note: random seeds not available for this case % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../a...
24c277df49444f2cb25a903fbebbf630556e6da20d33116401aa55acb099eabc
MATLAB
3,783
98
% check Eculidian distance vs monomodal EEG or fMRI connectivity % SI Table 12 % % 2023-10-13 Jonathan Wirsich euclDist = getEuclidianDistanceDesikan(); %import Euclidian dstances for Desikan fsaverage vec_ED = model.Connectome.getLoopedVec(euclDist); [confs, confs_label, groups, eeg_conn_types, bands, atlases, seria...
758f3a49088bae26f0ec25656cf5a9a7ee5ca0599e3b67ba3fe993f2d9c5cd61
MATLAB
3,783
104
% 4th model space MS_name = 'MS_FADE_04'; MS_axis1 = {'PE', 'TD'}; MS_axis2 = {'00x1', '00x2', '0x1', '0x2', '1dd-ip', '1dd-cp', '1dd-lr', '1th-l', '1th-a', '1th-s', '2nf', '2nr', '2ns', '3', '5'}; GLM_names = cell(numel(MS_axis1)*numel(MS_axis2),1); for i1 = 1:numel(MS_axis1) for i2 = 1:numel(MS_axis2) ...
7c98954fb68284cc758855ea0ca0dafed2fd02e4910c54f1bdd976260b2d50f8
MATLAB
3,789
117
function getNODDImaps(pathIn,pathbval,pathbvec,pathMask,folderOut,Basename,NODDImodel,NODDIfix,NODDIval) % Fit and get NODDI parameter maps % % pathIn: path to dwi (.nii) file % pathbval: path to bvalues (.bval) file (FSL style) % pathbval: path to bvectors (.bvec) file (FSL style) % pathMask: path to mask (.nii)...
5257bda505246408d9898416c194abba69969615de8590c5cd3389a6f3fffa99
MATLAB
3,790
111
classdef MLCaiNeuron < handle properties spatial_footprint; spikes trace_filt; trace_raw; timestamps_ms; %calciumEvents; % computed from the time series numTimeSamples; neuronId; % Its number in the neuron.hdf5 file end %...
e6d606a97726ee9d8ed3221af7bb5e0e90edb18fca4628f4e8bb43b72d6b0b8e
MATLAB
3,790
145
tic %% open/read file and set up Environment activateCEDS64 WAVELENGTH = 999; file = 'Z:\1_Maxwell_Gagnon\ProjectData_Ruth\191217\191217_VSFP_Mouse_1_x2_VOR.smr'; fhand1 = CEDS64Open(file); % Drum Position [ ~, sineWave, ~ ] = CEDS64ReadWaveF(fhand1, 3, 600000000, 0); % FLUOR Signal [ ~, chan11, ~ ] = CEDS64ReadWaveF(...
447241685d470cef23be5475343b0646fee9d057c1c3b4b45c6c08efc5f12eca
MATLAB
3,794
107
function [SUMtable, SUMarray, SUMtableCell] = Summary(iSes,nose,SUMtable, SUMarray, SUMtableCell) globals; SUMtable(iSes).iSes = iSes; SUMtable(iSes).Sesname = Sesname; SUMtable(iSes).mouse = Tagging.mouse; SUMtable(iSes).date = Tagging.date; SUMtable(iSes).mouseNo = Tagging.mouse(end-1:end); SUMtable(iSes).nu...
f7c9227ee960967ff8da79b02e8df8f7eb3989b07be4c9f6aacf30e9d742eefb
MATLAB
3,795
94
% looks at overlap between nnUNet output and a hippocampal mask generated % via affine to CITI168. Note most of the time these will already be affine % registered but not when the --rigOnly flag was used (ie. in TSE data) %% ASHSatlas (7T-TSE) addpath(genpath([getenv('AUTOTOP_DIR') '/tools'])); ref_mask = [getenv('AUT...
75d9c2a425346637f9459e07264caf4b5aa74c9ea98d9ffe06ff65b6189f11d3
MATLAB
3,798
100
addpath('funcs'); % [r,v,g] = once(0.3, 0.015, 0.02, 2000); p_base = [0.1184, 0.1552, 0.0846, 0.0629, 0.0323, 0.0000, 0.0076, 0.0000; 0.1008, 0.1371, 0.0363, 0.0515, 0.0755, 0.0000, 0.0042, 0.0000; 0.0077, 0.0059, 0.0519, 0.1453, 0.0067, 0.0003, 0.0453, 0.0000; 0.0691, 0.0029, 0.1093, 0.1...
379190ebc252211450a4ba07b600a6f0da16a3cb5b5388c86957c686a9c8e6a1
MATLAB
3,799
103
% function invcompE(tol,N) % % Return metrics relating to receiver operator characterics (ROC) for % Eventer output. The invcompE function must be run within an % eventer.output/Data_chX_wavename directory. The root directory of the % original eventer analysis should contain a text file called % 'EventTimes.txt' or Ev...
696974543cc0df82e2708f63f88b37445aed6365bff3dcca0e9ec79683f97d04
MATLAB
3,799
147
function [chi_M, chik_tkd] =SFCR_m_SB(deltaB, D_k, DPWeight, maskErode, maskSS, wG, lambdaSet, itermax, thred) % [chi_M, chik_tkd] =SFCR_m_SB(deltaB, D_k, maskErode, maskSS, wG, lambdaSet, itermax, thred) % SFCR M-step using Split-Bregmen L1 solver % % Input: deltaB, D_k, maskErode, maskSS, wG, lambdaSet, itermax, ...
0797a17e4702306696aa148b08703c5475c038cd780d0fae2f87f1ec76a11dd8
MATLAB
3,802
128
function[data,h]=SONGetEventChannel(fid, chan, varargin) % SONGETEVENTCHANNEL reads an event channel from a SON file % % DATA{, H}]=SONGETEVENTCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}}) % % FID is the matlab file handle and chan is the channel number (1-max) % If START/STOP are absent, all data is read. When presen...
d393ef814106df69fb7511b381e8289fbe9524093e268aef0f6c79d8a9911e15
MATLAB
3,802
108
function [H,details] = vl_harris(I,si,alpha) % VL_HARRIS Harris corner strength % H = VL_HARRIS(I,SI) computes the Harris corner strength of the image I % at ``integration'' scale SI. % % The Harris strength [1] of a pixel is a statistic of the gradient % of the image integrated in a neighborhood of that pixel. Th...
aeb4b86aea8abd013b55957e8647dc53c6bebbe351954170964ffa9305bb40b7
MATLAB
3,803
78
function subject_FD_parse_BIDS(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm,result_dir,output_prefix) % Code from OHSU Fair Neuroimaging Lab % Written (2014) and commented (9/8/2015) by Eric Earl % % FD parsing Nipype wrapper pulling in list of motion files % % Modified to read (and ignore) DVAR_pre_reg, ...
e88ab09c6abb79d2990d061d79a3489094258360d47dfd3f9b1623d078b6a6e7
MATLAB
3,805
94
function [gp_vals] = masked_3DGP_v2(grid_sz, l_scale, p_scale, mu, bin_mask, threshold, l_weights) % [gp_vals] = masked_3DGP_v2(grid_sz, l_scale, p_scale, varargin) % % This function draws from a 3-D GP with mean mu, length-scale l_scale and % variance scale parameter p_scale. Basically it returns a volume X, where %...
59c12184c4f0687c12a991d968c1e4a1e9c120113bd8f5f6487de1774e206d54
MATLAB
3,808
77
classdef AlignedDynamicTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % ALIGNEDDYNAMICTABLE DynamicTable container that supports storing a collection of sub-tables. Each sub-table is a DynamicTable itself that is aligned with the main table by row index. I.e., all DynamicTables stored in this group M...
527afb7b7fd17092c9280b75de878b697e62be8e3eca7e1141058bf788743201
MATLAB
3,810
94
function cfg_artifacts=st_expand_artifacts_to_segments(cfg_artifacts) % ST_EXPAND_ARTIFACTS_TO_SEGMENTS expands artifacts from bad channels across segments % % Expand artifacts across all segments of channel when proportion of unrejected artifacual segments >= badchannelthresh % % Use as: % cfg=st_expand_ar...
1505fb9ebae9d84ab2032c5054d592c42ba01c1fe5ff673f331b3a102e33436b
MATLAB
3,816
87
function [I Q F]=motif4funct_wei(W) %MOTIF4FUNCT_WEI Intensity and coherence of functional class-4 motifs % % [I Q F] = motif4funct_wei(W); % % Functional motifs are subsets of connection patterns embedded within % anatomical motifs. Motif frequency is the frequency of occurrence of % motifs around a no...
5a549faa5cb8add72832f7a5b04d3c00dad2e2aa52b131c020d5070ab503a24c
MATLAB
3,816
163
function [layers, net_output_info, dag_net]=gen_network_featnet_imgraw(featnet_config) dag_net=dagnn.DagNN(); start_var_name='data_input'; layer_gen_info=[]; layer_gen_info.one_output_dim=3; layer_gen_info.one_outputs={start_var_name}; layer_gen_info=do_add_img_input_scratch_path(dag_net, featnet_config, layer_ge...
7457084ddfabe2cfaba223b960aeaea492354012dd13374a89b6cb92b321c70c
MATLAB
3,818
76
function [GDPIndex, GDP_Onsets, GDP_Offsets, data_sorted, options] = detectGDPs(data, Nrois, options) % This functions detects GDPs from Ca2+ transient (CaT) times as obtained from multi-neuronal Ca2+ imaging. % ==========================================================================================================...
244e38873047d6b481578600f8b9cb8a79ec2f84daeefc736e75a1e1511e2d5e
MATLAB
3,819
139
% mglDispVisualAngleDiscrepancy.m % % $Id:$ % usage:mglDispVisualAngleDiscrepancy() % by: justin gardner % date: 03/29/10 % purpose: Display the discrepancy between what you ask for and what you % get in terms of visual angle based on current settings % of mglVisual...
6f26e985f60c916d63daa8ee8d6d782ee90ea937fe5b2fcaece85f5fa3b9de3c
MATLAB
3,822
107
function [] = Fig01_BidirRespMod_Normalized() % Code for plotting the mean change in ΔF/F after song-type transitions relative to ΔF/F before the transitions in Fig. 1j,m. GT = 'dPR1NPTN1SGNP'; % Fig. 1j,m switch GT case 'dPR1TN1SG' ylimrange1 = [-.3 .6]; ylimrange2 = [-.3 .6]; case 'dPR1NPTN1...
0b62213ad239f7eabba24cf57b6db8ee6277578396ac215f185706c285d624eb
MATLAB
3,824
82
%%% THIS CODE PERFORMS THE FOLLOWING FUNCTIONS: % 1. Extracts LFP data for each experiment of interest % 2. Identifies individual channels as bad based on user defined RMS voltage, ignores these as well as internal reference channel, and also removes sync channel % 3. Saves processed LFP data together with processin...
62c16e2ac680a9dc5b628574bacd4d15d9c927f18ff75523ca5c3a32cc97896d
MATLAB
3,825
78
function filtStreaming ( obj, fs, data_type, filterType, order, varargin ) % Filter LFP signal from streaming recordings % % Syntax: % FILTSTREAMING( obj, fs, filterType, varargin ); % % Input parameters: % * obj - object containg data % * fs - sampling frequency % * filterType - type of filter selected % ...
b5c1c410dd8108e8f7333f0e2a8fefadb68572f82ebbed384864b1ec6c09766d
MATLAB
3,826
102
%Calculate cluster correction for a F-observed and the permutation %distribution % %EXAMPLE USAGE % >> [h, p, clust_info, est_alpha] = Fclust_corr(F_obs, F_dist, 0.05, chan_hood, 3.84) % %REQUIRED INPUTS % F_obs - An electrode x time points array of observed F-values % F-dist - A permutation x ...
c83088d346f414934a90bfb75929d65fe639762222e16de0b2ce2e124528c122
MATLAB
3,828
148
function varargout=stitchedPlanesToVolume(channel) % Write stitched image planes from a channel to multi-page TIFF % % function fname=stitchedPlanesToVolume(channel) % % PURPOSE % All planes of one channel to a multi-page TIFF. Only a good idea for smaller datasets. % For larger datasets see resampleVolume.m % % % INP...
1c56152c5e316961a0c1282221085049d25b85bea7968a231fee16af657ba2a7
MATLAB
3,829
112
function [renumId] = SolvingTSP(target_new) %SOLVINGTSP target_new‚ðxz•½–ʂɂ¨‚¢‚ċ߂¢‡‚ɔԍ†‚ðU‚è‚È‚¨‚·ŠÖ” % Ú×à–¾‚ð‚±‚±‚É‹Lq nStops = size(target_new,1); stopsLon = target_new(:,1); stopsLat = target_new(:,2); idxs = nchoosek(1:nStops,2); dist = hypot(stopsLat(idxs(:,1)) - stopsLat(idxs(:,2)), ... ...
6193f727a58fb8c123dc3eeef8edefc60be9d582059fe5496e172efe6357a45b
MATLAB
3,829
126
% run_simulations_stdFR_stdRP.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../simulate'; }; addpa...
a56df3c5f1c558ce2fb1f2d3bedd7564ca6c8e76ffb48cca786cf4b3dc13017e
MATLAB
3,832
119
% % Diagonality plots. % % PARAMETERS % $NETWORK % $DECOMPOSITION % % INPUT % dat/decomposition_split.{source,training}.$DECOMPOSITION.$NETWORK.mat % dat/decomposition_split.training.sym.$NETWORK.mat % dat/split.$NETWORK.mat % dat/means.$NETWORK.mat % dat/info.$NETWORK % % OUTPUT % plot/diagonality.{self,base}.[a]...
b4e85b34f9117a963e9358ca0f003f06be65a2395da8302a0e636a37b9e0d67b
MATLAB
3,832
85
function fH = makeFigure6_PRFModelFits(ds,roisToPlot,spatialModel,temporalModel,saveFigs, saveFigDir) % Function to reproduce main manuscript figure 6: % panel a/b: V1 & VO1 time series + LSS, CSS, CST model prediction for each stimulus condition % panel c: violin plots showing cross-validated R^2 for LSS, CSS, CST m...
aeb8168a4d5691c43894929631cd878f078847589d885f0a19d5b8033bc9d127
MATLAB
3,833
126
% run_simulations_stdFR_RPk0nr3.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../simulate'; }; add...
33880a0dd559e29e2e45b3aba0bc1213124ee06fdb16e9faf83cb9454a55f7ae
MATLAB
3,834
99
function memStats = memoryInfo() % Cross-platform function to get memory usage % % @author Sviatoslav Danylenko <dev@udf.su> % @license BSD % % Return values: % memStats: memory info @type struct. % % The following is the fields of memStats: % free: the amount of free memory in ...
8d3385c9207151f2ceb2d4951d45ba7c86ac657b4c616f06f33951f0d89ecf4d
MATLAB
3,836
116
clear; close all; subs = ls('datasets/HCPaging100/hippunfold/'); subs = strsplit(subs)'; subs(end) = []; subs(74)=[]; % this subject seems to be missing from subjects_info.csv %subs(31)=[]; % missing from ashs subs(51)=[]; % this subject seems to be missing from subjects_info.csv %% load all data T = readtable('dat...
b140dea8a3be6468653eb5527496b1d924cd6cc47aa4ee113057642a50daa1e1
MATLAB
3,837
126
% run_simulations_stdFR_RPk0.4nr4.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../simulate'; }; a...
ee5d489d2d9730ffcb4d42f87f387025993e653e9a5d3d6eb8ca049528de6969
MATLAB
3,837
92
function data = TDMS_readFileHelper_v2(fid,optionStruct,metaStruct,paramsStruct) %TDMS_readFileHelper_v2 % % SECONDS_IN_DAY = paramsStruct.SECONDS_IN_DAY; CONV_FACTOR = paramsStruct.CONV_FACTOR; UTC_DIFF = paramsStruct.UTC_DIFF; STRING_ENCODING = paramsStruct.STRING_ENCODING; %INPUT UNPACKING %...
769f45d8d1fc18588e35bb427b08ebf87a0cdd94c78e267c9f4bb1bb8a0736a0
MATLAB
3,838
143
% results = eyeAnalysis % Run this to eye track on saved image files % Adds to a results structure that already has time info % to do - have ROI picked automatically based on pupil radius size, and % move with pupil %% Parameters - try changing if needed load settings prevsettings = 1; % Shouldn't need to change unl...
02b2d46e6cdc6600ae1b41802fb5f8132faeaab0a227e6686413b02e82b18292
MATLAB
3,840
101
%% early/late trial,neron reponse onset clear file=dir('ACC*uncertain*.mat'); earlylick=[]; latelick=[]; k1=1;k2=1; for jj=1:length(file) load(file(jj).name) totalevent=sort([Events.C1S3;Events.C1S5;Events.C1S12]); hit=find(outcome(:,1)==1); for i=1:length(hit) cuetime=totalevent(hit(...
a8817b082f8fb3e4e9c2b353c7497d8ed353985b0f283b68c539922a3a8843bf
MATLAB
3,840
126
% run_simulations_stdFR_RPk0.7nr18.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../simulate'; }; ...
a04325473d9a4713deafa18082c27f42a5851f5020ec0d73b8dd2412bd5a3a74
MATLAB
3,841
129
% clear,clc; ShapeSurfPath = '/media/data2/Epilepsy_Shape/Templates/Shape_Surf'; ShapeStatisticPath = '/media/data2/Epilepsy_Shape/Data/Shape_Statistics'; %% Load Summarized Shape Features LogJacs_csv = importdata('/media/data2/Epilepsy_Shape/Data/Shape/LogJacs_all.csv'); Thick_csv = importdata('/media/data2/Epilepsy_...