sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d9a6d2c3a6ebf0622c2422d5861a2f0b14fd57a9b1867836b6c3c08ce49cbcd1
MATLAB
4,323
117
% Bonferroni-Holm (1979) correction for multiple comparisons. This is a % sequentially rejective version of the simple Bonferroni correction for multiple % comparisons and strongly controls the family-wise error rate at level alpha. % % It works as follows: % 1) All p-values are sorted in order of smallest to largest....
b569c734eea6ef1b9dcf016828261f6cce18e0a15c81c74f4b43553dee368bb7
MATLAB
4,327
108
%% write_mff_data.m % Matlab File % author Colin Davey % date 3/2/2012, 4/15/2014 % Copyright 2012, 2014 EGI. All rights reserved. % % Writes channel data (newData) in newData to an MFF file. NewData is a 2-D % matrix of size Nchans*Nsamples as described at % http://fieldtrip.fcdonders.nl/reference/ft_read_data...
a203808ec0e42c93a18c6a35d01d2976b972f4c65abb93777bed100eda102581
MATLAB
4,328
109
function [p, placeMap, activeMap, occupancyMap, notVisitedMap] = ml_nlx_placemaps_compute(visitedPos, activePos, activeVal, boundsi, boundsj, varargin) p = inputParser; p.CaseSensitive = false; checkVisitedPos = @(x) size(x,2) == 2 && size(x,3) == 1 && isnumeric(x); addRequired(p,'visitedPo...
8d5386e3911c6efdb1ea007a439e01562e2a1d203d945e308def6b72fa6cac44
MATLAB
4,330
144
%{ For the LE(t) for each run and each participant, stack them and conduct k-medians clustering with a specified k for one random iteration of 500. Output: subclust_*.h5 Clustering for this iteration. subcent_*.h5 h5 Centroids for this iteration. substat_*.h5 Clustering-based metrics for this iteration. %} %Define c...
e88e487ff8e55cb3d038df51cdfd9cc1c0e16d61bb4bb7bfb6d190b7e861177b
MATLAB
4,330
90
function Experiments = TimeSegmentCompare() %TimeSegmentCompare compares the LNP fits from different parts of %experiments, not used in paper % Detailed explanation goes here fps = 14; EarlyStartFrame = 1; EarlyEndFrame = 10*60*fps; LateStartFrame = 20*60*fps+1; LateEndFrame = 30*60*fps; fram...
d677f726740459ff8d12ef847e958aaa727e49e5b20680d47a079ee8ce5e8c63
MATLAB
4,331
107
% twoPhotonSettings.m % % Function that returns all the CONSTANTS for a two-photon experiment % % OUTPUT: % dataDir - name of base data directory % exptFnDir - name of folder containing all experiment functions % settings - struct of settings % % Created: 7/25/18 % Updated: % 7/30/18 - HHY % 4/29/21 - HHY - ...
23030346f6ed5c800f496cf74e53bf0fb6a6033ddb771a1dc4e1a796e27849d5
MATLAB
4,333
170
function brain_masking(DATA,ROI,AddInfo) % BRAIN_MASKING - Try to mask the (Rat) brain % (this is an Aedes plugin) % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka...
64b38fe7c2ba362b44e447bff13b7f1c9bdea27ec3f95224066836407a8fce31
MATLAB
4,333
97
function subject_power_2014_motion_parse_v2_opt_octave(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,output_dir) % FD parsing Nipype wrapper pulling in list of motion files % Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store % values appropriately in the 51x51x3 cell array o...
b5c41409f8b3d1e2ddb29ba0adcaf2738ab29ce1ffc047f66df62afc3dbd4c31
MATLAB
4,333
100
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [T] = compute_per_group_animal_averaged_rate_difference_matrix(SessionsToGroups, RateMatrices, perCellNormalizationMethod, perAnimalNormalizationMethod) uniquePairs = unique_groups_sessions_to_groups(SessionsToGroups); ...
1c72c075d2384506a2ed5272eb9d8f8d89f78cc979463fd69b09a00744c40e7e
MATLAB
4,335
112
classdef fuzzy_vor_AOI < voronoi_AOI %UNTITLED2 Summary of this class goes here % Detailed explanation goes here methods function self = fuzzy_vor_AOI(all_pois, trail, allowed_angle, max_vor_distance) %UNTITLED2 Construct an instance of this class % Detailed explanat...
14e119446c3a8d0d44e118f366cbf265817ae409b66a8ec1bfa194f9030cdb87
MATLAB
4,336
136
% taskTemplate.m % % $Id$ % usage: taskTemplate % by: justin gardner % date: 09/07/06 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: Test function which will turn the cursor on / off (and change the fixation color to % green when it should be display and red when ...
949854ae000acf50301635977685e46f1b49672d3f1d2736a76ac6cff893b0a3
MATLAB
4,339
122
% data_name = 'lowBG=5e+03,poisson=1'; addpath(genpath('.')) gcp; %% num_Exp = 10; list_Exp_ID = arrayfun(@(x) ['sim_',num2str(x)],0:(num_Exp-1), 'UniformOutput',false); rate_hz = 10; % frame rate of each video avg_radius = 6; % original_masks r_bg_ratio = 3; leng = r_bg_ratio*avg_radius; th_IoU_split = 0.5; thj_inc...
d2c506009b510ff924e83c14dfb02ce6d7d3cf74358fd0b50580badd9c128032
MATLAB
4,339
142
%% LOAD load('ds_events.mat') load('ds_partialcorrsn.mat') load('id_list.mat') %% ORGANIZE/ COMBINE [ds_ct_corr,sep_corrs]=organize_corrs(ds_partialcorrs,id_list); all_corrs{1,2}=[sep_corrs{1,2},sep_corrs{2,1}]; all_corrs{1,3}=[sep_corrs{1,3},sep_corrs{3,1}]; all_corrs{2,3}=[sep_corrs{2,3},sep_corrs{3,2}]; %% FI...
d00aa2ae163cf02c19684426be63169a2b56fa85a18ccc2127713b042f3e771b
MATLAB
4,349
165
%Sample code %Davor Curic, 2023, Complexity Science Group, University of Calgary % %This code loads the avalanche analysis and calculates critical exponents %tau, alpha, gamma, and the scaling relation %This code requires pvcalc and plmle from the NCC toolbox %https://github.com/nctoolbox/nctoolbox FR = 50; ...
b2d04cef6640a8a0702902d76a81d6c125145af0a600c8efff0b42a036811a50
MATLAB
4,352
155
close all clear all clc sessionsToUse = [2]; project = ml_util_json_read('project_config.json'); expRich = dir(fullfile(project.dataFeatureRichFolder, '**', 'experiment_description.json')); miceRich = initMice(expRich, project.analysisFeatureRichFolder); plot_mice_groups(miceRich, sessionsToUse) expPoor = dir(fullf...
3c4fda229b21ff7eb7108bdf1b362cc99b776435f17edd751e2bb08af4edb12a
MATLAB
4,355
91
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [analysisSettings] = analysis_settings_load() analysisSettings = []; % This should never be set manually here, as the shuffled pipeline will % set them. analysisSettings.USE_SHUFFLED_MAPS_AT_INITIALIZATI...
3e2e7d664f3ed8b0783c0b28186c3c65d825bac19318a916564f648af23c0bde
MATLAB
4,356
178
%% Set up clear;clc; close all A = chanData; A.expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\jennifer_arch'; A.bFiles = dir([A.expmtDataFolder '\**\*']); eFiles = A.bFiles(contains({A.bFiles.name}, {'ephys.mat'})); A.bFiles([A.bFiles.isdir]) = []; A.bFiles(~contains({A.bFiles.nam...
d9e4378ea13ae9439117a33fc8dd842a9e044b68283a4168efeac89ae3fdb3be
MATLAB
4,356
142
% checkFictracNoise.m % % Function to load in FicTrac output files run on same video (testVid.avi % from 201104), outputdatatest2-4.dat. To check whether offline run of % FicTrac produces the same or different output (especially wrt noise) % when run with identical parameters on the same video). function checkFictr...
2de08fa5cc1b067d2db9b25da5305a224c82249440683b5784448d4ac355a961
MATLAB
4,357
96
function subject_power_2014_motion_parse_opt_BIDS(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,output_dir,output_prefix) % FD parsing Nipype wrapper pulling in list of motion files % Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store % values appropriately in the 51x51x3 cel...
4716b7ba6a633e9739ca9b80c9d4ffd9b65d6738c2e82442c87e1c8452cbde05
MATLAB
4,360
118
% Author: Zachary Chiang, Buenrostro Lab, Harvard University % Uses cross correlation and intensity-based registration (imregister) to % register one stack to another in x, y, and z, both stacks should be % maximum intensity projected in the channel dimension and then the % registration is applied to all channels sepa...
26b008ed54a5a01b75b70eef1e8ea96aad8311517b79f9b9dc283d25526ce81a
MATLAB
4,361
118
function [outEEG, errorflag] = jointdecorrelation(inEEG, thresh, eventtype, scale) % Joint correlation % [outEEG, errorflag] = jointdecorrel(inEEG, thresh) % % Inputs: % inEEG: EEG struct of EEGLAB % thresh: Threshold for BCG correction % eventtype: EEG.event.type that serve as a reference point i...
4e9f3484f4235920137bfe451d87dbafa67b8c760f563f9d8954e32670a940e8
MATLAB
4,366
140
% run_simulations_highFR_stdRP_1_iter_extra_info.m % to generate a new set of % 540 x 1 simulations % (# param combos x # iter) % stored out with some extra information %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../fi...
cf94471f272a0d24ee11f1f1f2ad75dd0539a0286c734c03b6f610ca638218fa
MATLAB
4,368
141
function lm = ridgefitModelPredictionToData(data, predictions, alpha, ... regressionType, offsetFlag) % Function toFit model prediction to data at single voxel level % % lm = ridgefitModelPredictionToData(data, predictions, alpha, ... % regressionType, offsetFlag) % % INPUTS % data : (double...
14b2fe606514e630470d9a0c2a5468ccdd45a653919737514a2a6aa22b21c9ba
MATLAB
4,369
133
function[data,h]=SONGetTextMarkerChannel(fid, chan, varargin) % SONGETTEXTMARKERCHANNEL 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 wi...
5e2d827a744db904e45fd956009ef754eea3276f07eb8be16805f027d0a9f152
MATLAB
4,369
163
function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be left em...
962912fca106fe620dfebded9bb07e5ff9f4eefd7affd86f303169d765d645c2
MATLAB
4,370
103
function status = filtSurvey( obj, fs, filterType, order, bounds ) % Filters LFP Survey recordings, using a Butterworth filter. % % Syntax: % status = FILTSURVEY( obj, fs, filterType, order, bounds ); % % Input parameters: % * obj - object containg survey data % * fs - sampling frequency % * filterType - l...
d4f44f8d0a788a3cabe1b6243b6bef00b85f8ec0c17ad408b54ec01f65163d64
MATLAB
4,370
133
% set up paths [pathstr,name,ext] = fileparts(pwd); usedir = pathstr; codedir = pwd; maindir = fullfile(usedir,'bids','sourcedata','Scan-Lets_Make_A_Deal') logdir = fullfile(usedir,'bids','sourcedata','Scan-Card_Guessing_Game','logs') subs = load('sublist_all.txt'); % make default output out.ntrials(1) = 0; out.ntria...
5edb9dec512e8638a2cd1d35c746d2f8674ccaff9e19c5dc6913cb626a6755a0
MATLAB
4,371
141
% VL_DEMO_COVDET Demo: VL_COVDET() % -------------------------------------------------------------------- % Basics % -------------------------------------------------------------------- im = vl_impattern('roofs1') ; im = im(end-128:end,128:320,:) ; figure...
c5f6f8d0512a01c1cacaabe1036909852b585c4b80d2671920c5709b57621e85
MATLAB
4,372
135
function output = smoothCellBody(allpaths,cellBody,fdims) connIdxRoot = zeros(length(allpaths),3); emptyIdxs = false(length(allpaths),1); for i = 1:length(allpaths) path = allpaths{i}; if(~isempty(path)) pathInd = sub2ind(fdims,path(:,1),path(:,2),path(:,3)); pathIntersect = ismember(pathInd,cellBody); ...
033d2dca3ae7220b7aac66db925e0df2914ac63796e63e9a4708e0d5e0ff49de
MATLAB
4,374
105
% preprocessFreeWalkLegTrack.m % % Function that takes in full path to .trk file and returns preprocessed % leg tracking data (leg position and velocity) in struct. % .trk file is output from APT % % Modification of preprocessLegTrack on tethered flies % % INPUTS: % trkFilepath - full path to .trk file % frameTim...
3d5139a7a3a39c0999b439d871149a7ac99bff6a51310e3e92c51c6200c12b7a
MATLAB
4,374
142
function filtered_movement_regressors(path_mov_reg, TR, filt_option, order, LP_freq_min, filt_type, fc_RR_min, fc_RR_max, brain_radius, output) %% This function applies a low pas filter to the motion numbers and save it with a different number % %% Input arguments % path_mov_reg Path until MNINonLinear/Results ...
845fac82bc720fdf0b4cc2ca860dfe103d7810275fd929fb17f77e304760fc16
MATLAB
4,377
138
% plotAvgImgVFictrac.m % % Function to plot output of moveCondPairData() as dF/f vs. FicTrac param. % Plots average across flies and/or individual flies. Plots data only from % moving time points % % INPUTS: % whichImg - which imaging data to plot ('diff', 'sum', 'right', 'left') % whichFictrac - which FicTrac pa...
96d59deb521381fc9293338bdf89e53f1c9780a53d1a526386af50b4ba8b1974
MATLAB
4,378
155
% threshDrawROIs.m % % Allows user to select ROIs from an image. First, user sets threshold in % dF/F; then, user draws rough region around ROI. ROI is intersection of % greater than threshold and within drawn region. Repeat for all ROIs. % Number of ROIs determined by user input at beginning. % Uses built-in Matlab...
de5486db15a581f424663a22101ccbb9d5c8206dd7a9d0c34c6907fc84a13142
MATLAB
4,378
71
%experiment name save_folder = 'results'; %data folder save_params = {'SC','HAD_S','OPT_S','FOV'}; %which structs to save %flipper SC.motors_flags.flipper = 1; %flipper motor ono %BSI SC.BSI_settings.flag = ...
7c0d65e66f3c2e5730f1558f7148c1a9f19a47b75a67cc73d3b63eb7bb63ec1f
MATLAB
4,379
148
function state = dss_core_symm(state) % Symmetric DSS algorithm % state = dss_core_symm(state) % Calculates denoising source separation for a collection of % mixed signals. % Components are forced orthogonal with symmetric orthogonalization. % Begins or continues calculation defined by state structure...
1e2d123227303591c719fbb58973331fd8cf01337bfd1ff8c963e198b200f513
MATLAB
4,381
112
% This script creates the mesh (both CAD surface mesh and a computational % wire grid) for a MagVenture figure eight bent coil with 1 A of total % current % The output is saved in the binary file coil.mat and includes: % strcoil.Pwire(:, 3) - set of nodes for all wires % strcoil.Ewire(:, 2) - set of e...
92b34723ba979f37a73841a933f0d4669483688da054fe87007e3a1b22c94722
MATLAB
4,386
151
function chi_S = SFCR_s_SB_k(deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, x) % chi_S = SFCR_s_SB_k(deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, x) % SFCR S-step using Split-Bregmen L1 solver, k-space version % % Input: deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, x % % DPW...
4ab2d110d79e57ed6efa6bf859f040533156849857d2823a968f69c9821764f6
MATLAB
4,387
87
function p = bemf5_volume_field_potential(Points, c, P, t, Center, Area, normals, Size, eps0, R, flag) % Computes electric potential for an array Points anywhere in space (line, % surface, volume). This field is due to surface charges at triangular % facets only. Includes accurate neighbor triangle integrals for ...
9a94505e3a44bcc3036cfdfca5afa9945ad842f73064995434a0c943becae8ee
MATLAB
4,387
150
% make figure on Arp, % threshold 1.15 excelname='Fig1A Arp3_LifeAct_NoTreatment'; experiment='arp_lifeact'; %use a shorter name to save all the plots channel1 = readmatrix(excelname,'Sheet','Channel1'); timeinterval=readmatrix(excelname,'Sheet','time interval'); script_BatchProcess_IPI p2p_allconditions{1}=p2p_all...
2d1f9a76c35c4bfe49bcb21a7672bdf983439d2bd0d826508320f999fec61bac
MATLAB
4,389
106
function [I, IRho] = potint(r1, r2, r3, normal, ObsPoint) % This function computes single potential integrals I = Is(1/r) and % integrals IRho=Is(vec(r)/r), respectively, and % follows the method described in: Wilton DR, Rao SM, Glisson AW, % Schaubert DH, Al-Bundak OM, Butler CM. Potential integrals for ...
53ea8e30c5ae00141cd05a3c5c486b2175bd6cade824b4ce89b547c15a733719
MATLAB
4,389
150
function [] = ExtDataFig08_OptStim_TuningCurve_Neuron() % Code for plotting the tuning curves of calcium signals induced by optogenetics in Extended Data Fig. 8b,e. GT = 'pIP10'; Target = 'pIP10_NR'; % Extended Data Fig. 8b % GT = 'pMP2'; Target = 'pMP2_NR'; % Extended Data Fig. 8e switch Target case 'pIP10_NR' ...
722809306a19132ca979cef3877516f57d99d4f00ce8549f81b9a72727781d14
MATLAB
4,392
112
function fH = makeSupplFigure7_DoGPredictions(projectDir,ds,lmmResults, ... lmmResults_Model,modelName, roisToPlot,cmapModels, useSTRetParams, ... temporalModel, spatialModel, subjnrs, saveFigs, saveFigDir) % Function to reproduce supplementary manuscript figure 7: % panel a/b: V1 time ...
0c62c88b5744f25641054fbc075fb583788712583ff81ccceff42cadf87a67ac
MATLAB
4,395
103
% Get permuted split-half of fMRI connectomes % SI Table 3 manuscript % % 2022-08-22 Jonathan Wirsich [confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_conf_tle(); perm_iters = 5000; perm_iters_conf = zeros(length(confs), 1); for atl=1:1 conn_group = cell(length(...
9846125f0ab8f212ebcddb95bf3d4adbb8ff8b72d2aef8996fbc7b81826e3aa0
MATLAB
4,395
196
function [tablib,msg] = aedes_readphasetable(filename) % AEDES_READPHASETABLE - Read VNMR table file % % % Synopsis: % [tab,msg]=aedes_readphasetable(filename) % % Description: % The function reads and interprets a Varian phase table file % "filename" given as a string input argument. The phase or...
f86d3a809f9cb4e898e757c4ba0257aae8971eaada8a65b049eb9c48a101d7df
MATLAB
4,395
129
%% ANOVA stats for DNa02 SPARC2D GtACR1 datDir = '/Users/hyang/Dropbox (HMS)/OptoBehaviorAnalysis-Helen/AnalyzedData'; whichParam = 'stepXLengths'; whichPhase = 'stance'; vels = 0; NDs = 0; yScale = [-0.2 0.2]; plotAvg = 'mean'; plotIndiv = true; plotDiff = false; uni = plotOptomotorOptoDiffLegStepParam_allFlies(datD...
a65b46dc7fe03d4527e2610a853f501818546a4bd75fd79f38cfbbb96484ded0
MATLAB
4,399
92
function [P, t] = meshsurface(Pcenter, a, b, M, flag) % Outputs a 2-manifold P, t mesh for a single arbitrarily % bent conductor. The conductor could be either open or closed. In the % last case, the start point and the end point must coincide. % Inputs: % Pcenter - centerline of the conductor in 3D [:, 3]; ...
84dd25a44099809ac5c3133435c0b39bb78028e929500ea5a2b4756a57ce86dd
MATLAB
4,405
115
% Fig 10. Benchmarking analysis results for sample size % 10b. Binarry Classification % 10c. Regression %% Set up clear; clc; % Load Data basedir = '/Users/donghee/Documents/project'; % set a path to local project directory githubdir = '/Users/donghee/github'; % set a path to local git directory for external code...
b88550f0f8479d6778e749ba937697f9570d649d597e215cc93991ff5cd49dbc
MATLAB
4,409
85
function out = groupzproject(images,groupsize,type) % out = groupzproject(images,groupsize,type) % % Function to project a 3D matrix along the third dimension in groups of % the specified size. The inputs are % % - images - 3D matrix to project in groups % - groupsize - Size of projection group. Needs to be...
581add89d8b6510551ad6b79c5d58a72bddefd048946f11b3f1ed88a25f61495
MATLAB
4,411
76
function active_track_indecies = PlotFrame(FigH, Frame, Tracks, frame_index, all_deleted_tracks, behavior_colors) figure(FigH) clf; %imshow(Frame,'InitialMagnification',300); imshow(Frame,'InitialMagnification',40, 'Border','tight'); %this determines the figure size that the mpeg encodes, which has to be a particular ...
4b1b8d18934bc20759267e2b6eb147fc50cf95bb594055769d2d2835bf8859ba
MATLAB
4,412
117
%This script allows the user to pick a watershed region in a t-SNE map and %finds when the animal stays in that region and plots their behaivor %% STEP 1: establish plotting constants N_rows = 4; N_columns = 4; N = N_rows*N_columns; fps = 14; frames_before = 1*fps-1; frames_after = 1*fps; duration = frames_before+fra...
9b121e0d35e08d20256d83ed8d3a4c01869c1b761efe6bafcce9e230d000b3b0
MATLAB
4,413
121
% shiftRotateNormalizeLegPos.m % % Function that takes in raw leg X and Y coordinates (output from % loadTrkFile) and returns coordinates that are shifted and rotated to % align all the frames to the center point of the fly (midpoint between 2 % midlegs) and normalized so the units are body lengths (instead of % pi...
5b00e97bfb5ccb27b86d162d22f543aa8913641d64024de3facfa448331cb001
MATLAB
4,420
147
function h = plotCircadian( obj, varargin ) % Plot the circadian mean power. % % Syntax: % h = PLOTCIRCADIAN( obj, ax ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % % Example: % h = obj.PlotCircadian(); % h = PLOTCIRCADIAN( obj ); % h = PLOTCIRCAD...
107cc86c0effa1e16d80b9a55833390e29b91dcb1e1361b98aca0397efb7f6c9
MATLAB
4,421
93
% ----------------------------------------------------------------------- % % H Y D R A % % ----------------------------------------------------------------------- % % Function 'sampen' computes the Sample Entropy of a given signal. % % ...
f69bc6a67557383e0b763bc099eb3d18e547d380a0748fab0a6cd64814b54430
MATLAB
4,421
117
function simseq_prepareStimulus(sessionDir) % sessionDir = vistasoft session in simseq project folder. % for example, '/oak/stanford/groups/kalanit/biac2/kgs/projects/spatiotemporal/experiments/simseq/data/subj01/session1' % Get number of runs/files d = dir(fullfile(sessionDir,'simseqPRF*.mat')); % Define params fs =...
3589013cc7711ef729fa22111c90d934750d55c12b1acedfd299f0669c001e1b
MATLAB
4,423
130
function vl_printsize(varargin) % VL_PRINTSIZE Set the printing size of a figure % VL_PRINTSIZE(R) adjusts the PaperPosition property of the current % figure to make the figure paper width equal to R times the width % of a 'uslsetter' page, while preserving the aspect ratio of the % figure. Then, it sets the P...
46856e5d7cba1b718a66fff3123baed8ee3a6e33145e1a999b66c97cabe883a8
MATLAB
4,423
157
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function make_stabilitybfo90_percell_formatted_for_sigmastats(analysisSettings, analysisResults, outputFolder) BestAligned = analysisResults.BestAligned; F = 'NormalPerCell90'; T = analysisResults.(F); [SessionsToGroups] = load_se...
38da088172752141b65de1e5ef52c237cfc694f274fd18702f3fa99d2b9cc689
MATLAB
4,424
123
addpath(genpath('.')) gcp; %% % name of the videos list_Exp_ID = { 'c25_59_228','c27_12_326','c28_83_210',... 'c25_163_267','c27_114_176','c28_161_149',... 'c25_123_348','c27_122_121','c28_163_244'}; num_Exp = length(list_Exp_ID); rate_hz = 20; % frame rate of each video avg_radius = 4;...
c567c085c79f9f71a14a2d6483995e634cc017624f72ead1b936e9ca86502454
MATLAB
4,426
94
% data_ind = 1; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th5'); % data_ind = 2; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4'); % data_ind = 3; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4'); % data_ind = 4; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF50','4816[1]th4'); % data_ind = 1; dir_SUNS...
d6acd948976fb741fd656bd9f82041097ccd67855cdfff5bd94487b91770f040
MATLAB
4,431
121
% addCalculatedVar.m % % usage: addCalculatedVar(varname,varval,stimfileName) % by: justin gardner % date: 08/06/10 % purpose: add a computed variable to a stimfile % % e.g.: addCalculatedVar('newvar',[1 3 4 5 6 2 8 10],'100728_stim01'); % To specify taskNum (default=1) and phas...
5be827b9d25f36a08a987dcc3770c7c58d724c33b693ea05ad99b0cd95a3af7d
MATLAB
4,437
169
function nifti3dto4d(infiles,outfile,varargin) % NIFTI3DTO4D - Convert a series of 3D NIfTI volumes to a single 4D NIfTI % file % % Synopsis: % data = nifti3dto4d(infiles,outfile,param1,value1,param2,value2,...) % % Description: % % Examples: % % See also: % % This function is a part of Aedes ...
e11aab5150beba2dab8be37e0dddfabd57958be5b9c97e4343c768a82d749115
MATLAB
4,437
115
% findFlyNotMovingMidlegs.m % % Function to find when the fly isn't moving, based on the criteria that % the 2 midlegs are not moving in X (velocity below threshold). % Finds based on smoothed velocity below threshold and non-smoothed % velocity also below (separate) threshold % Returns indicies of not moving times %...
9f7ae6ae224578752de12cfa89f12f7b92eda981b7d9c961aee10605ba1e1ac7
MATLAB
4,440
116
%% write_mff_history.m % Matlab File % author Colin Davey % date 4/15/2014 % Copyright 2014 EGI. All rights reserved. % % This function adds an item to the list of history items. It is intended % to be run after running code that either a) creates a new mff file based % on an existing one, or b) modifies an exis...
41b57a26ac696fa4d1b718534ca7451d034729dc4a0d39d0ed6d11a5ae3972fc
MATLAB
4,441
96
% re-compute tune from saved Tuning, and updates unitsTable if UPDATE_unitsTable==1 % uses the structs and functions of tune and tuning, but saves them corr % uses unitsTable while running, but saves the data in: % - unitsTable (mat and xlsx) if UPDATE_unitsTable==1 % - corrTable (mat and xlsx) if UPDATE_corr...
77705512915d6f146641cc36a36b0209a18ef2c71c2983723bb48d2eec2804b6
MATLAB
4,441
132
function [IFF]=openiff(fid,LEN) % OPENIFF is an auxillary function to SOPEN for % opening of IFF files % % Use SOPEN instead of OPENIFF % % See also: fopen, SOPEN % % References: % This program is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License % as pu...
ec95ba5932b02b3b2999e570ff232f348791f760721e5aa1f460a19fed651b67
MATLAB
4,442
143
function [psd_out] = one_event_res_psd(src_spk_vec,stevt,endevt,psdopt) %one_event_res_psd.m win_len_msec = psdopt.win_len_msec; psd_out.win_len_msec = win_len_msec; assert(mod((endevt-stevt)*1000,win_len_msec) == 0,... 'this function assumes that mod(duration,win) = 0') src_spk = toCol(src_spk_vec); min_oscil_s...
dc28a5b6593f8ac8bb272fe0b5e2ec9f11ca7e61bae6c007fbb148bb51811efa
MATLAB
4,448
172
function output_info=cnn_layer_dense_softmaxloss_forward(input_info, layer, work_info_batch) stageout_info=layer.stageout_info; stage_idx=stageout_info.stage_idx; mc_info=gen_mc_info(input_info, work_info_batch); work_info_batch.ref.finalloss_mc_info_stages{stage_idx}=mc_info; examp...
92c2d1c1c266539c25a7ab88e0edc155dde6d7ee2b404734e75599e56de7017e
MATLAB
4,451
180
function [ax] = specStatFig(specStruct,fld1,fld2,figopt) %specStatFig.m clrsMap = containers.Map(); clrsMap('sig') = [0 1 0]; clrsMap('orig') = [0 0 0]; % comp = shuffling "compensated" (orig/mean shuf) clrsMap('comp') = [0.3020 0.0784 0.5490]; clrsMap('thr') = ones(1,3)*0.35; clrsMap('shuf') = [1 0 0]; clrs...
6ae57f2b442ee25672a2d65f2c0df34fd9f205d4b5075a36748c777f09ede8a4
MATLAB
4,454
44
function rval = rtest_3_cojocaru() % The regression test for the bug reported by Radu Cojocaru on 9 November % 2006. The error is getting erroneous edges in the minimum spanning tree. % The cause of the error is that mst outputs exactly n-1 edges for the % minimum spanning tree. However, if the graph is disconnecte...
ef0a67a8505b3a5472db46c786c38b2cf555e0b5f4255922753ba4c1e692997b
MATLAB
4,454
164
function hdr = load_analyze_hdr(hdrfile) % hdr = load_analyze_hdr(hdrfile) % % hdrfile is the header file (eg, f001.hdr) or a basename (eg, f001). % % hdr.dime.dim(1) = number dims % hdr.dime.dim(2) = number of items in first dim % hdr.dime.dim(3) = number of items in second dim % ... % % hdr.dime.datatype: % 0 unk...
29d584c450888ca42e304f1634771c50bc24ac43d4a4490a1d079c2460f79e57
MATLAB
4,455
99
function [targetonfig,x_fig,tform_fig,tform_fig_inv,BregmasOnPano,errorIdx] = RotationMethod(pano,imgc,target) %ROTATIONMETHOD ‚±‚̊֐”‚ÌŠT—v‚ð‚±‚±‚É‹Lq % Ú×à–¾‚ð‚±‚±‚É‹Lq pointsPano = detectKAZEFeatures(pano,'Threshold',0.00001); [featuresPano, pointsPano] = extractFeatures(pano,pointsPano); BregmasOnMask = [s...
87604caa70ad76d3c637014a0d3ee524234012b19af48dd7f4176518b47146d9
MATLAB
4,457
127
% computeAvgFictracOpto_1Fly.m % % Function that extracts the mean, std err, and individual responses % to optogenetic stimulation of different durations and intensities (ND % filters) for a single fly. % User selects all pData for that fly through the file selection GUI % Saves the data as a struct in path specified...
dec0eb89dd59748d6f80f253424503385608575cf91e5a815c9ed8d03a9973e8
MATLAB
4,459
109
% This is a one-off script. It was written to process the concatenated % CNFMe into the separate trial results %% READ MEE % Run this only when the experiment.json is referencing the UNCATTED % session names or it will overwrite what we want!!! close all clear all clc config = mulana_json_read(fullfile('R:\chengs_ta...
9568356462f65a842905bf30c43c3e764a7cd4ec8156333f4e9ae5ddeb6eade3
MATLAB
4,461
108
%# usage: [Zz, Zp, Zg] = bilinear(Sz, Sp, Sg, T) %# [Zb, Za] = bilinear(Sb, Sa, T) %# %# Transform a s-plane filter specification into a z-plane %# specification. Filters can be specified in either zero-pole-gain or %# transfer function form. The input form does not have to match the %# output form. 1/T is the...
cc307851390ddc1d4734a65886f51f197a26353ab9f85dccdbbff1a82a7f4d67
MATLAB
4,461
112
%% CREATE VARIABLES/ SET PARAMETERS if ismac base = '/Volumes/Runyan/Potter et al datasets/'; else base= 'Z:\Potter et al datasets\'; end datasets = {'EC1-1R/2021-11-05/', 'EC1-1R/2022-01-13/','FL5-3L/2022-03-09/','FL5-3L/2022-04-18/','FU1-00/2022-03-17/','FU1-00/2022-05-10/','GE3-00/2022-10-27/',... 'G...
7bb1423a6254c86678a3ec3e2261c1d9be73fe6696d0bd721934844c5b585e18
MATLAB
4,464
120
function [ stimAmp ] = extractStimAmp( obj, data, parameters ) % Extract and visualize stimulation amplitude from Percept PC JSON files % % Syntax: % [ stimAmp ] = EXTRACTSTIMAMP( obj, data, parameters ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % * parameters - ...
40c7d8877f873f592ab32b3ded424335ae147a9861e51e07243e5c84a03cc79a
MATLAB
4,468
117
% preprocessFicTracOnly.m % % Temporary variant of preprocess just to update FicTrac data (because % previous lowpas filter cutoff wrong). % % On imaging data: % Reads in ScanImage .tif files. Aligns each time series. Saves the aligned % series, unaligned series, mean image, and metadata output by ScanImage. % % On ...
b96f034c6598fc3fe168534760b4a411960782a7f4bd161ce4f34f22da8c2788
MATLAB
4,468
122
% getVarFromParameters.m % % $Id: % usage: getVarFromParameters(varname,e,<allPossibleVals=0>) % by: justin gardner % date: 03/16/07 % purpose: get a variable name from task parameters, could be % will return the full qualified name of the variable % e is returned f...
1763ff9de037b6371dc17bbe17bf8d95110897daeeeb715e5888c032a525a17d
MATLAB
4,469
152
function VOR_Summary_Amin_gcStep(params) %% Extract important Information from Excel file and result .mat file figg = figure(234); ka = tight_subplot(3,3,[.025 .025],[.025 .025],[.025 .025]); figg2 = figure(235); ta = tight_subplot(2,2,[.025 .025],[.025 .025],[.025 .025]); slotVec = [1, 4, 5, 6, 8, 10, 12, 15, 16]; lo...
30e6683e366f38808c9d19377373ad12ab71fb32519069d8276103176908be29
MATLAB
4,470
85
function vol_params = check_vol_params(vol_params) % vol_params = check_vol_params(vol_params) % % This function checks the elements of the struct vol_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - vol_params - Struct with pa...
43444b7404554b210b612b3115e3cb17bdb0c3d7335c8a40d9400273860b8581
MATLAB
4,471
117
% preprocessOpto.m % % Function to update metadata spreadsheet for behavior-only experiments % run using the EphysCode-Helen codebase for each trial with all the % metadata that is saved during the experiment. Fields that require user % input posthoc are left blank. % Assumes metadata spreadsheet has the arrangement...
b82fdacbd085aa42a0c35eee736758f9eb145ec089d5b31d9bdb0e112348f011
MATLAB
4,473
90
clear stable=load('stable.mat');uncertain=load('uncertain.mat');reverse=load('reverse.mat');restable=load('restable.mat'); shSI=[{nan(493,1000)} {nan(493,1000)} {nan(493,1000)} {nan(493,1000)}]; for i=1:493 go=[stable.population.goHit.eachDF{i}(46:90,:) stable.population.goMiss.eachDF{i}(46:90,:)]; goR{1}=...
81687923897375331d75f79cae68555ce7df3e110ba583fdb7a32a99274168fc
MATLAB
4,475
134
clear all close all clc trackedParts = ml_cai_dlc_to_tracked_parts(pwd); iEarLeft = 1; iEarRight = 2; iMiniscopeLed = 3; iHip = 4; iTailBase = 5; dx = trackedParts(iEarRight).x - trackedParts(iEarLeft).x; dy = trackedParts(iEarRight).y - trackedParts(iEarLeft).y; thetaRad = atan2(dy, dx); i = find(thetaRad < 0); the...
9dbe089cfb32cfc1dcbfc9f4d2a9f3cc341542e9019f9e5a594fa1e9e85ffcb9
MATLAB
4,477
138
%{ Provides comparison of various moving averages on learned component traces. INSTRUCTIONS: 1. Set "Current Folder" to the one containing the excel file. 2. Ensure data is in the first sheet, with "time" as the last column. 3. Modify the five variables below as needed. 4. Run script. Generates figures displaying...
bb7b1f69da993eb316c0475c116257b4deb7e5a5fcf7db3d2d10213df919b098
MATLAB
4,478
150
function dcm_info(pathname,add_params) % Print some information from DICOM files exported from PACS % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Physics, Department of Neurobiology % University of Kuopio, FINLAND % % This program may be used under the terms of the GNU General...
c41bf553a1f10b714c6dd1eac8ddd2c139282f23042428dc3cb1c8421f4737dd
MATLAB
4,479
136
% computeSmoFictrac2P.m % % Function that takes in one or more pData files and computes a very % smoothed version of the FicTrac velocity parameters. To be used for % extracting turning bouts, not to be used as faithful representation of % actual velocities. % Select pData files through GUI. These must have fictrac...
1df18147a2baf4c74d0b8f2459e1ff34f3b11cde28770b6ead66d26db5d72636
MATLAB
4,481
116
% anigauss - Recursive anisotropic Gauss filtering % Usage: % out = anigauss(in, sigma_v, sigma_u, phi, % derivative_order_v, derivative_order_u); % % v-axis = short axis % u-axis = long axis % phi = orientation angle in degrees % % parameters sigma_u, phi, and derivative_order_{v,w} are option...
1ef39da4521a6e3837959ad00158bda2343d3b0066da4a49694169d426c8ef2a
MATLAB
4,481
165
function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be left em...
ed4fb48059942e6fa87bdc576c02420f0206f2c4eed859db8d47614e703b30f3
MATLAB
4,483
137
function[data,h]=SONGetRealMarkerChannel(fid, chan, varargin) % SONGETREALMARKERCHANNEL reads an RealMark channel from a SON file. % % [DATA {, HEADER}]=SONGETREALMARKERCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}}) % FID is the matlab file handle, CHAN is the channel number (1=max) % % [DATA, HEADER]=SONGETREALMARKER...
aecdd35c83748dd1fbdf558609bf3b7e3852f47ce38497fea9ac02533ca41df8
MATLAB
4,484
119
%% CREATE VARIABLES/ SET PARAMETERS if ismac base = '/Volumes/Runyan/Potter et al datasets/'; else base= 'Z:\Potter et al datasets\'; end datasets = {'EC1-1R/2021-11-05/', 'EC1-1R/2022-01-13/','FL5-3L/2022-03-09/','FL5-3L/2022-04-18/','FU1-00/2022-03-17/','FU1-00/2022-05-10/','GE3-00/2022-10-27/',... 'G...
61f8a860c7bdb365f827471c65039ca49253473b5857e55c07fcec395ec8393a
MATLAB
4,485
149
close all clear all clc tfolder = pwd; d1 = load( fullfile(tfolder, 'behavcam_roi.mat') ); % The coordinates of the reference points in the video frame (pixels) refVidPts = [d1.behavcam_roi.inside.i'; d1.behavcam_roi.inside.j']; % The coordinates of the reference points in the canonical frame % For the rectangle/sq...
8c4a2e3927b289b23e5c23ccc7adcf8c8e777f7352ae922575872cedb5f05dca
MATLAB
4,488
159
% fig3_res_illustrate.m % generates figure 2 using stored values used for manuscript %% clear all; close all; clc; %% addpath if not added yet % assumes script run within local directory scriptdirs = {'../../plot';'../../helper_functions'}; addpath(scriptdirs{:}) datadir = '../fig2'; datafile = 'figs_2_3_shuf_res_ill...
e59e9a6f556323d7f16d2e2256b52707e93de54554f632d6865d67fd43bde921
MATLAB
4,488
148
% plotAvgEphysContParam_fly.m % % Function to plot output of getCorrelationEphysContParam_cond_all() as % average across flies and/or individual flies % % INPUTS: % datDir - path to folder containing savePCAinterpStepParam() output files % avg - 'mean' or 'median' for which type of average to plot % indivFlies -...
aed453bcb709fa5f3b9296770e3f9bdd46389cad79d0787c5984e6cf1a177e73
MATLAB
4,489
117
function [dat] = ft_preproc_padding(dat, padtype, prepadlength, postpadlength) % FT_PREPROC_PADDING performs padding on the data, i.e. adds or removes samples % to or from the data matrix. % % Use as % [dat] = ft_preproc_padding(dat, padtype, padlength) % or as % [dat] = ft_preproc_padding(dat, padtype, prepadleng...
21653cc1e0641a42a10cc369f8f9a4f37682ea23946f47aa1c63238d4a2dbb9c
MATLAB
4,490
111
%% para %% run after matlab 2018 version file_name_all = {'Edge_GLM_gene_str_dis_commu_gene_PLS_DBM.mat',... 'Edge_GLM_gene_str_dis_commu_gene_PLS_VBM.mat'}; for ifile = 1:length(file_name_all) file_name = file_name_all{ifile}; load(file_name) z_thr = -icdf('normal',0.05,0,1); GO_size_min = 0; ...
c24ac5b7d9955c2855ac4c404ac5485aa6ee7a5117d54fcfa5174303f864983a
MATLAB
4,490
180
clear all close all clc % This script reads in EVfiles from the ISTART project and counts the % number of high/low, accept/reject we have for each participant. % Daniel Sazhin % DVS Lab % 01/26/2022 % Temple University %% Set path and subjects maindir = 'C:\Users\danie\Documents\Github\istart\UGDG\Behavioral_Analys...
2cd3ee297d28e2c907209ccc1ce6dad66e25dcc51d948075be48c00f0de88545
MATLAB
4,492
134
% computeSmoFictrac.m % % Function that takes in one or more pData files and computes a very % smoothed version of the FicTrac velocity parameters. To be used for % extracting turning bouts, not to be used as faithful representation of % actual velocities. % Select pData files through GUI. These must have fictrac, ...
5d300f2852db88a0838617d06d81d6d5fc9b2e1a397183703d8fc4a7f8b8055a
MATLAB
4,493
144
%# Generate an Chebyshev type II filter with Rs dB of stop band attenuation. %# %# [b, a] = cheby2(n, Rs, Wc) %# low pass filter with cutoff pi*Wc radians %# %# [b, a] = cheby2(n, Rs, Wc, 'high') %# high pass filter with cutoff pi*Wc radians %# %# [b, a] = cheby2(n, Rs, [Wl, Wh]) %# band pass filter with ed...
d3d7037253a0f7ac33083107328efa660fe203b008e1495a6483a08701f7acaa
MATLAB
4,493
153
function [bestWaveletsAll, PalmNet] = findBestWaveletsTesting(imagesCell, orient_default, orient_best, PalmNet, numImagesToUse, imageSize, param, stepPrint, plotta) %init bestWaveletsAll(param.numBestWavelets).filter = []; %-------------------------------------- %Compute parametrized wavelets parametrizedWavelets = ...
522a6e4faeaa69a3ef26a1f5cb4c39ae634fd6868e3c3860f69e8fb5c3309dcb
MATLAB
4,495
165
%% MAIN function to extract NB propagation %% Loading data clear close all clc [filename, pathname, filterindex] = uigetfile('*.mat', 'Select NetworkBurst file'); if isempty(strfind(filename,'NetworkBurstDetection')) errordlg('Selection Failed - End of Session', 'Error'); return end cd(pathname); load(filena...
f61517a9bff196c7c2e707a45c48d5735c757a9b878cb34cacdf58307a517b58
MATLAB
4,495
124
addpath(genpath('.')) gcp; %% % 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); rate_hz = 20; % frame rate of each video avg_radius = 9; % added_refined_masks % avg_radius = 10; % original_m...