sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
38d0f1fc657678b034361d1fb24150155944925324aa6ff81393bbb666379123 | MATLAB | 11,198 | 364 | function saveastiff(data, path, options)
% options.color
% : true or FALSE
% : If this is true, third dimension should be 3 and the data is saved as a color image.
% options.comp
% : 'no', 'lzw', 'jpeg' or 'adobe'.
% Compression type.
% 'no' : Uncompressed(Default)
% 'lzw' : lossless LZW
% ... |
596b615644bd1684c00adf64aff017b067cfaac247bccff82250dc83b3104cf5 | MATLAB | 11,206 | 301 | ImagePath = '\Path\To\Zenodo\Data'
allen_atlas_path = '\Path\To\GitHub\allenCCF\';
Redo = 0;
AllMice2Use = {'Becquerel','Berlijn','Cherry','China','Chopin','Faraday','Galilei','Haydn',...
'Holland','HongKong','Jemison','Jenkins','Karlsen','Kirchoff','Leeuwenhoek','Lully','Mahler','Sebald'};
Genotype = {'D2','D2',... |
ba0a2495e9a92da2d5d655f264533d49096468bb38a3283ffd749ca11f42ecec | MATLAB | 11,218 | 162 | clc, clear
% ------------------------------------------------------------------------
% Chimpanzee batch options that can be changed in the GUI or here directly
% ------------------------------------------------------------------------
% open the chimpanzee preprocessing from cat12
cat12('chimpanzee');
% set the nu... |
f30651c5acf0ea5c3e37b732f9f2ae571a2c09fce63148c3d4b1535f05bf961a | MATLAB | 11,232 | 231 | function [prfs, params] = getPRFs(params)
% Description: Function that takes spatial model as input to get either
% standard 2D Gaussian or CSS 2D Gaussian.
% INPUT:
% params : (struct) Params struct should have the following fields:
% * params.analysis.spatial.fieldSize - (int) radius of FoV in deg, assumi... |
a02e486bca583bc4d1d7457870d7433d06801cc2ce99233cf8039dac9988926a | MATLAB | 11,238 | 284 | function varargout = behavior_explorer_gui(varargin)
% behavior_explorer_gui MATLAB code for behavior_explorer_gui.fig
% behavior_explorer_gui, by itself, creates a new behavior_explorer_gui or raises the existing
% singleton*.
%
% H = behavior_explorer_gui returns the handle to a new behavior_explorer_g... |
05d5d9051a835c0b6eee8c5d8e245d2f435a091243b5d8f146ad1470a52d0fc4 | MATLAB | 11,248 | 357 | function makeHeader
%Generates the header files edf2mex.h which contains necessary mex structures and functions
%to read data from C structures defined in edf_data.h and load them into similarly organized
% mxArray structures.
%
% To use this, make sure that the edf header files edf.h, edftypes.h, edf_data.h are in th... |
3c4c1c05fa2ac296c6bae729298550ae0df1ad2fa099bb432ec4a387452d579f | MATLAB | 11,254 | 357 | function makeHeader
%Generates the header files edf2mex.h which contains necessary mex structures and functions
%to read data from C structures defined in edf_data.h and load them into similarly organized
% mxArray structures.
%
% To use this, make sure that the edf header files edf.h, edftypes.h, edf_data.h are in th... |
76fa33c78479eb617eb56c6089db726bbc1ca4541799559a9f06ef80c851493b | MATLAB | 11,254 | 320 | % getTaskEyeTraces.m
%
% $Id:$
% usage: e = getTaskEyeTraces(stimfileName,<taskNum=1>,<phaseNum=1>,<dispFig=0>,<dataPad=3>,<removeBlink=1>)
% by: justin gardner
% date: 06/23/10
% purpose: get the eye traces for a task. Pass in a stimfile name and the
% taskNum and phaseNum you... |
2d73367c95367d7f513d9f5f9a9b805d6cbb221a97daa18622bf93bb1e1c100d | MATLAB | 11,256 | 320 | % getTaskEyeTraces.m
%
% $Id:$
% usage: e = getTaskEyeTraces(stimfileName,<taskNum=1>,<phaseNum=1>,<dispFig=0>,<dataPad=3>,<removeBlink=1>)
% by: justin gardner
% date: 06/23/10
% purpose: get the eye traces for a task. Pass in a stimfile name and the
% taskNum and phaseNum you... |
3bc2cf0379a43c04a29ae8b7804fbbaf5026ee90e61c151b46621546f91e151c | MATLAB | 11,277 | 326 | % SCANSURFACE In this step, the three-dimensional surface of the brain is scanned using an infrared sensor.
% The skull is removed for accurate scanning.
% Based on the surface data, the camera height is automatically adjusted for fine-focused surface images.
% The acquired images are used to segment blood vessels usin... |
2fb5b9720bfdc3c05ab4a29189a8d5db908d50c8b72d44b99847aa746e15dfe8 | MATLAB | 11,285 | 247 | clear
RUNSIMPLE = 1;
SAMPLETIME = 40; % ms
zeroIdx = 21; %101;
binEdges = -20.5:1:20.5; %-100.5:1:100.5;
load ('Alon_maxCorrValAndIdx_normalized_multi_minAndMax.mat');
% maxCorrIdx
% vStim
% vTrial
% do2Stim
% do2Trial
binCenters = binEdges(1:end-1)+floor(mean(diff(binEdges))/2);
currXlim ... |
8127d0334ada1e2d07eec18aa982587d2e6739ad1bfaa7b40d3d143c53fe1821 | MATLAB | 11,296 | 260 | function [] = E2_ModelSelection(predictor_data,badSubs)
% MODEL SELECTION STRATEGY
% the idea is that you have to find the model which is associated with the
% smallest AIC and BIC.
% predictor_data = which data to be predicted from LVs: 1.1 -> alpha (all conditions) 1.2 -> alpha(load conditions separated)
% ... |
70b0984ae151d1056eaadc2fa53ba6317ed8642000d7185ab98ae075cd8ffa88 | MATLAB | 11,297 | 300 | function [MatchProbability,label,Tbl,BestMdl] = RunNaiveBayes(Predictors,TotalScore,Scores2Include,clusinfo,param,SortingOrder,EuclDist)
%% Extract parameters
if param.GoodUnitsOnly
Good_Idx = find(clusinfo.Good_ID); %Only care about good units at this point
else
Good_Idx = 1:length(clusinfo.Good_ID);
disp... |
4d65c0ac995585908a01cb23c28bb87bde82ea1da23126f21d29071488726a04 | MATLAB | 11,309 | 235 | % s_simulateDoGPRFTimeSeries.m
% Set params
projectDir = fullfile(simseqRootPath);
subjnrs = [1,2,3,7:13];
hemi = {'both'};
prfModel = 3; % Use linear pRF model to get center size
veThresh = 0.1;
plotFigures = true;
loadStoredSimulation = false;
roiType = 'stimcorner4_area4sq_eccen5... |
c46978bea49d1bdbbdea9a40d5a95815c735d3b431af47857ff2672fe4db5ad2 | MATLAB | 11,333 | 349 | function [M,h] = spm_maff(varargin)
% Affine registration to MNI space using mutual information
% FORMAT M = spm_maff(P,samp,x,b0,MF,M,regtyp,ff)
% P - filename or structure handle of image
% x - cell array of {x1,x2,x3}, where x1 and x2 are
% co-ordinates (from ndgrid), and x3 is a list of
% ... |
60fd3fb9d6ecdae2567217bdb0c899284ee9d9934ebd8f73057cc05fd8334770 | MATLAB | 11,336 | 296 | function vars = getScaleFactors_APP(app, vars)
%% SETUP
try
a = vars.mag1;
catch
vid = [];
mag1 = [];
mag2 = [];
end
freq = vars.CaliStimFreq;
%% LOAD VIDEOS
% Camera 1
try
A = load(fullfile(cd, 'videoresults_cam1.mat'));
catch
error('Camera 1 Results Not Found: videoresults_cam1.mat')
end
r... |
6090af498bd1aebbc1ff9cd3f41c15286e31c8140b9128d1c6d190e718e7907a | MATLAB | 11,337 | 214 | %% s_prepareDoGResults
projectDir = '/oak/stanford/groups/kalanit/biac2/kgs/projects/spatiotemporal/';
hemi = {'both'};
prfModel = 3; % Use linear pRF model to get center size
veThresh = 0.1;
sizeRatio = [7.4, 6.8, 7.3, 5.8, 4.2, 4.2, 4.7, 5, 3.3]; % V1,V2,V3,hV4,VO,V3AB,IPS,LO,TO
surroundFun ... |
7e2d1182f4f1e0775f242a15f9d19927545d624bc7f449bb8ec0cb58b45b0252 | MATLAB | 11,338 | 287 | % Clear the workspace and the screen
clear;
close all;
sca;
% Set the global variables:
global isTestMode white black photoSquareSize
% Prompt for the subject name:
[subjectName, isTestMode, distanceFromScreen] = runInput();
disp(['Subject Name: ', subjectName]);
disp(['Test Mode: ', num2str(isTestMode)]);
disp(['Dis... |
fe656550492ee99ba07e9130d5c8d72459211e5a2eade5844365d45a5f83f6fb | MATLAB | 11,341 | 270 | classdef WebConfigTest < matlab.unittest.TestCase
% Tests for webupload.webConfig (loading, validation and token protection) and the
% file-name whitelist.
properties
Dir
end
methods (TestClassSetup)
function addPackageToPath(tc)
tc.applyFixture(matlab.unittest.fixtures... |
a55c2981a1596eea9187475a0c0a9f502f3e2fb66edea2a59d55316f7abef343 | MATLAB | 11,352 | 279 | % f_ReadInfo.m [As a part of HFO Detection Project]
% Written by:
% Miguel G. Navarrete Mejia
% Electrical Engineering MS
% UNIVERSIDAD DE LOS ANDES
% Colombia, 2012
% mnavarretem@gmail.com
function st_Info = f_ReadFileHeader(pst_SigPath)
% Reads header information of signal files
% INPUT:
% pst_SigPath... |
549e1062cca5034ba48180159df10032a39ea103ce758f1363311e088899d5ad | MATLAB | 11,359 | 250 | function Results = gretna_prediction(Predictors, Responses, K_fold, C_type, C_thr, R_type, Ncomp, Lambda)
%==========================================================================
% This function is used to predict different response variables using
% multiple predictive variables based on different models.
%
% Synt... |
6aafd8e21f845aa761a12fd06f54c4a566282343017151d8bf0a0d0a7e905f89 | MATLAB | 11,379 | 283 | % legFictracEphys.m
%
% Experimental Function
% For simultaneous acquisition of leg video, FicTrac, and electrophysiology
% recording.
% Uses background acquisition on DAQ
% No current injection; use legFictracEphysIInj() instead
%
% INPUTS:
% settings - struct of ephys setup settings, from ephysSettings()
% durat... |
072787cd4e80f7bc1d3e66ba3a3f372a43c63038fe5178e82f3c97476a5eb103 | MATLAB | 11,385 | 308 | % This function returns resampled data or indices created by balanced bootstrap
% or bootknife resampling.
%
% -- Function File: BOOTSAM = boot (N, NBOOT)
% -- Function File: BOOTSAM = boot (X, NBOOT)
% -- Function File: BOOTSAM = boot (..., NBOOT, LOO)
% -- Function File: BOOTSAM = boot (..., NBOOT, LOO, SEED)
% -- F... |
49a8d3fcf5bfacb2378dab9612da078577973aaf119ecdb96ac22b69f6d9a30a | MATLAB | 11,387 | 316 | function params = makeStiminMS(params,id)
% makeStimFromScan - Make stimulus from stored image matrix for solving
% retinotopic model or predicting BOLD response.
%
% params = makeStiminMS(params,id);
%
% Notes:
%
% This code was written with the intention of using files generated from
% exptTools stimulus presen... |
47d290eb4a4b383ff578f47aef27f28e1ec91dee88eb8f3cdc1de12309bec59d | MATLAB | 11,396 | 386 | %% plot swing/stance, leg positions, ephys voltage, FicTrac velocities
f1XLims = [234 240];
figure;
ax1 = subplot(6,1,1);
plot(leg.frameTimes, legTrack.srnLegX(:,1:6));
% hold on;
% plot(leg.frameTimes(zeroVelInd), srnLegX(zeroVelInd,2), '.');
legend(legIDs.names);
title('Normalized leg position, front-back axis');
yl... |
cb1d754e927cd32ca1c94b1f821fb5fb89a44e39a993efb43bd5344e98cb74fa | MATLAB | 11,411 | 275 | classdef MLBehaviourTracker < handle
%MLBehaviourTracker This class tracks mouse behaviour
% This class tracks mouse behaviour by finding the position(s)
% of LED(s) that are mounted on the mouses head.
properties
ledPos = [];
end
methods
function obj = MLBehaviourT... |
835cca644ed84a612c0dc9d3ca5d21fd2340beb4f8611ab8ef658b51a6428246 | MATLAB | 11,420 | 241 | %%% demo of the full MIN1PIPE %%%
clear
warning off
gcp;
% To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary"
% if isempty(gcp('nocreate'))
% parpool;
% end
min1pipe_init;
addpath(genpath('../ANE'))
%% Set data and folder
list_data_names={'blood_ves... |
0d8181d702861a2585af4cfb490e28cbb45816ffd0f403bdc4fffac0c2b261e5 | MATLAB | 11,423 | 286 | function [] = main()
if ~isdeployed
disp('loading paths for IUHPC')
addpath(genpath('/N/u/brlife/git/vistasoft'))
addpath(genpath('/N/soft/mason/SPM/spm8'))
addpath(genpath('/N/u/brlife/git/jsonlab'))
addpath(genpath('/N/soft/rhel7/mrtrix/3.0/mrtrix3/matlab'))
addpath(genpath('/N/u/brlife/git/w... |
7652c3fd1f9c84e36dac26291d88d31347457b48f4d86aa488acecc6fc420715 | MATLAB | 11,437 | 355 | function [hs, hc, contour] = triplot(pnt, tri, val, mode, levels)
% TRIPLOT make 2D or 3D plot of triangulated surface and interpolated values
% The surface can be displayed with linear interpolated values or with
% linear interpolated contours of a potential distribution.
%
% Use as
% triplot(pnt, tri, value)
% t... |
a14a8f5db854a44d9142a8dbba4fb36659939e948a61e83bbf913acff1127b89 | MATLAB | 11,438 | 407 | % mglMakeMetal.m
%
% usage: mglMakeMetal(rebuild)
% by: justin gardner
% date: 09/28/2021 Based on version from 05/04/06
% copyright: (c) 2021 Justin Gardner(GPL see mgl/COPYING)
% purpose: rebuilds mex file, with no arguments checks
% dates to see whether it should rebuild. With
% ... |
ec353bd06f4498ca89330bafb3bcf530f06a8aa4ce1621f8924f22b73b94141f | MATLAB | 11,441 | 202 | function [] = make_tiled_movies_given_instances(Tracks, folders, saveFileName, possible_tracks, possible_frames, N_rows, N_columns, video_duration,display_field_name, highlight_index)
parameters = load_parameters(folders{1});
fps = parameters.SampleRate;
load('reference_embedding.mat')
%% STEP 1: estab... |
814575bcf70c8a5e953bd23a72092d723a0e0ca8ba2ae33b0e5a387aff90b3fc | MATLAB | 11,476 | 252 | function plotFiltDataStream( obj, filter_indx, varargin )
% Plot filtered LFP online streaming recordings
%
%Syntax:
% PLOTFILTDATASTREAM( obj, filter_indx, varargin );
%
% Input parameters:
% * obj - object containg data
% * filter_indx
% * ax (optional) - axis where you want to plot
%
% Example:
% PLOTFI... |
458185a1c7a4c4ebcf6d4155f0670fa7cd8c39025edd30f2239ba1f9b4931e41 | MATLAB | 11,478 | 162 | %function [tap_transition_rate_of_interest,control_transition_rate_of_interest,tap_transition_rate_of_interest_std,control_transition_rate_of_interest_std,h,p,tap_transition_total_count,control_transition_total_count,tap_observation_total_count,control_observation_total_count] = average_transition_probability_after_tap... |
74b14b4780c09ee35d250a24c8c18b07dad82765c01584896568b78ce2c852a0 | MATLAB | 11,488 | 342 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function compute_popvectors_across_contexts_unregistered(analysisSettings, BestAligned, BESTALIGNED_STABILITY_THRESHOLD_CRITERIA)
% Add the group labels (day names) to the data
SessionsToGroups = load_sessions_to_groups_table(analy... |
54afc2ea0ee1320d8fb5bf7a2f46a0cab083a9e865f8fbf299b8fab0a4c70737 | MATLAB | 11,493 | 330 | function [p,gof]=plpva(x, xmin, varargin)
% PLPVA calculates the p-value for the given power-law fit to some data.
% Source: http://www.santafe.edu/~aaronc/powerlaws/
%
% PLPVA(x, xmin) takes data x and given lower cutoff for the power-law
% behavior xmin and computes the corresponding p-value for the
% Ko... |
b8449fcc214f0cd86e11f5383b4126a555c2eff6b66e4f17c9fcc52ffc89d4a7 | MATLAB | 11,500 | 342 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function compute_popvectors_across_contexts_unregistered_v2(analysisSettings, BestAligned, BESTALIGNED_STABILITY_THRESHOLD_CRITERIA)
% Add the group labels (day names) to the data
SessionsToGroups = load_sessions_to_groups_table(an... |
720fc446792e6aebd7573a66114e84b6dea5927f85eae6e8699190e5196209cd | MATLAB | 11,505 | 317 | function params = makeStiminMS(params,id)
% makeStimFromScan - Make stimulus from stored image matrix for solving
% retinotopic model or predicting BOLD response.
%
% params = makeStiminMS(params,id);
%
% Notes:
%
% This code was written with the intention of using files generated from
% exptTools stimulus presen... |
0def60fd4d005c795d3cc1d5df1219bf422dbf81cdefae8055d4890a3e907be7 | MATLAB | 11,506 | 338 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [F] = compute_popvectors_across_contexts_unregistered_v3(analysisSettings, BestAligned, BESTALIGNED_STABILITY_THRESHOLD_MIN, BESTALIGNED_STABILITY_THRESHOLD_MAX)
% Add the group labels (day names) to the data
SessionsToGrou... |
f7a24d000986557bd99b7973dbdf03ccd345531f0ab35379efa791d80bae7d9c | MATLAB | 11,529 | 291 | % visstimLegFictrac.m
%
% Experimental Function
% For simultaneous presentation of visual stimuli on G3 panels and
% acquisition of leg video and FicTrac behavior data.
% Uses background acquisition on DAQ
%
% INPUTS:
% settings - struct of ephys setup settings, from ephysSettings()
% duration - duration of trial... |
18543471edc72b19a9af4ad9a06a0839aea97fc528374e89ff94be33c1b22864 | MATLAB | 11,532 | 330 | %{
TODO
- Vertical Lines to indicate cycle position
- Get start and stop points for all segments
- run each section
NOTES
segment 1: 763 - 4043, 40 range, 10/s --> 800
segment 2: 5563 - 6282, 10 range, 5/s --> 400
segment 3: 6363 - 7617, 10 range, 10/s --> 200
segment 4: 8683 - 10284, 20 ra... |
396044efc21231ab440631ddd23f5cc6ba7a0867021ef9a14bc1d6beece60fa8 | MATLAB | 11,533 | 224 | function [neur_vol,gp_bgvals, axon_params, vol_params] = ...
generate_axons(vol_params, axon_params, neur_vol, ...
neur_num, gp_vals, gp_nuc, neur_vol_flag)
% [bg_pix,neur_vol,gp_bgvals, axon_params, vol_params] = ...
% generat... |
56271801cee02e606f042415ef35a198de36bd4ab989f9bb983a90e08621bc63 | MATLAB | 11,539 | 304 | classdef MLSessionRecord < handle
% This loads a session_record.json file that contains
% the information on all trials performed in the session
properties (SetAccess = private)
jsonFilename;
json;
defaultStructStr = "struct('context', [], 'use', [], 'digs', [], 'sliceI... |
0b244400f93240039911bcc6e0cb6e9bde6b06eabc089394674fb4e07504c86a | MATLAB | 11,558 | 330 | function My_dpca_plot(Xfull, W, V, plotFunction, varargin)
% dpca_plot(X, W, V, plotFunction, ...)
% produces a plot of the dPCA results. X is the data matrix, W and V
% are decoder and encoder matrices, plotFunction is a
% pointer to to the function that plots one component (see dpca_plot_default()
% for the templat... |
11a0660721bfbe164fd3bc95a6d37913e24f7dc5181105ae2c78aa015f7ae917 | MATLAB | 11,566 | 227 |
%% Neural differences between young and older adults in automatic and conscious auditory predictive coding
%%% waveform plotting - computed on a local computer %%%
%%
%% MEG SOURCES
%% PLOTTING MAIN ROIs AND CONDITIONS TOGETHER (ALL SUBJECTS AT THE SAME TIME)
addpath('/Users/au550322/Documents/AarhusUniversitet/S... |
079c34296285c3413ecbe51a8e523d3b673bc89694f016155c433349f31a8b5e | MATLAB | 11,583 | 235 | %% clear the workspace and select data
warning off;
gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
scale_lowBG = 5e3;
scale_noise = 1;
data_name = sprintf('lowBG=%.0e,poisson=%g',scale_lowBG,scale_noise);
patch_dims = [253,316];
num_Exp = 10;
rate_hz = 10; % frame rate of each vi... |
2b816fe7c80146e308d08cce832165c6b09fb82a84c7ba0e35cbb2849baab14a | MATLAB | 11,584 | 248 | % Bootstrap Group Means of EEG-fMRI correlation
% Supplementary Table 6
%
% 2022-08-22 Jonathan Wirsich
[confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_conf_tle();
mdl_names{1} = 'lTLEvsrTLE';
mdl_names{2} = 'controlsVSrTLE';
mdl_names{3} = 'controlsVSlTLE';
for atl=1:1... |
4dba9cec2ab1f70f48ec3286a00f2b627e27fda34de2ddc06be991e8bdbc1d7e | MATLAB | 11,594 | 320 | function phow_caltech101()
% PHOW_CALTECH101 Image classification in the Caltech-101 dataset
% This program demonstrates how to use VLFeat to construct an image
% classifier on the Caltech-101 data. The classifier uses PHOW
% features (dense SIFT), spatial histograms of visual words, and a
% Chi2 SVM. To speedu... |
518a94bc8f0a31a3de5f93882a9b83d3aae0e678940bb6df0b77d368bcb78dcb | MATLAB | 11,599 | 333 | function source = ft_datatype_source(source, varargin)
% FT_DATATYPE_SOURCE describes the FieldTrip MATLAB structure for data that is
% represented at the source level. This is typically obtained with a beamformer of
% minimum-norm source reconstruction using FT_SOURCEANALYSIS.
%
% An example of a source structure obt... |
f4741a4960bc7e7996ab9568edd16cc59dafd70b0e70706315e1c30b2d21d731 | MATLAB | 11,600 | 303 | close all
clear all
clc
tstart = tic;
% Don't change these
projectCfgFilename = fullfile(pwd, 'project_config.json');
pipeCfgFilename = fullfile(pwd, 'pipeline_config.json');
% Load the project configuration
projectConfig = mulana_json_read( projectCfgFilename );
disp(projectConfig)
% Search for mice
[featurePoor, ... |
598db400021be39f7117bb4574403cbb5523d3af3359481cee10488dde645204 | MATLAB | 11,602 | 370 | %% Description errorb(x,y,varargin)
% errorb(Y,E) plots Y and draws an error bar at each element of Y. The
% error bar is a distance of E(i) above and below the curve so that each
% bar is symmetric and 2*E(i) long.
% If Y and E are a matrices, errob groups the bars produced by the elements
% in each row and plots the ... |
21d074e32cb63e9462abef2a55949c8a2250415d7109a59921fcce2ccf5db859 | MATLAB | 11,624 | 239 | %%% demo of the full MIN1PIPE %%%
clear
warning off
gcp;
% To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary"
min1pipe_init;
addpath(genpath('../ANE'))
%% Set data and folder
scale_lowBG = 5e3;
scale_noise = 1;
data_name = sprintf('lowBG=%.0e,poisson=%g... |
bcbd59c3574c86d3aa437a3b8186a7abc0c5a2bce85e361422aad199ce0df792 | MATLAB | 11,637 | 282 | function [FR_touch,FR_touch_correct,FR_touch_incorrect]=all_Tcurves_correct_incorrect_population
counter=0;
ff=dir('*.mat*');
Nsessions=size(ff,1);
percentile=0.95;
NpointsTcurve=4;
Nsamples_tuning_curve=nan(Nsessions,2);
FR_correct_incorrect_1=nan(Nsessions,2);
FR_correct_incorrect_later=nan(Nsessions,2);
change_exp... |
3a2f86b62b66adbbefbd145a33ef48223e341752dee187f70f285d3c1ce17573 | MATLAB | 11,639 | 303 | % getXCorrEphysContParam_cell.m
%
% Function to get cross-correlation between an ephys parameter and a
% continuous behavioral parameter (FicTrac or legStepsCont) for a single
% cell. Also reports time of peak cross-correlation and the value at the
% peak.
% Allows conditioning on additional behavioral parameter
% S... |
62d57400a451e558ddd75c8a9b3764791e6f82e6ae7045dee34366f6a8a42cb2 | MATLAB | 11,661 | 233 | %%% demo of the full MIN1PIPE %%%
clear
warning off
gcp;
% To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary"
min1pipe_init;
addpath(genpath('../ANE'))
%% Set data and folder
patch_dims = [160,160];
list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mou... |
c958875d3a66d738adce4b636801641754bf0ea457c2703e4092df9c20498aca | MATLAB | 11,664 | 309 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% If you use this code, then please cite:
% 1.- Ana P. Millan, et al. "Individualized epidemic spreading models
% predict epilepsy surgery outcomes: a pseudo-prospective study."
% medRxiv (2023): 2023-03. doi: https://doi.org/10.1101/2023.03.16.232873... |
d90d8e9ac66019ad2c35d4f1cd3c764c1a2d785233d78e01935e7f1381e991e9 | MATLAB | 11,664 | 190 | function [neur_soma, neur_vol, gp_nuc, gp_soma] = generateNeuralVolume(neur_params,vol_params,neur_locs,Vcell,Vnuc,neur_ves)
% function [neur_soma, neur_vol, gp_nuc] = generateNeuralVolume(neur_params,vol_params,neur_locs,Vcell,Vnuc)
%
% Function to place the neural soma in a volume. The inputs to this
% function are... |
a8e8edf895e164f9c998cdd8ce967877c1e7420330dc5d5c978466ec6513a1ff | MATLAB | 11,670 | 326 | function ft_progress(varargin)
% FT_PROGRESS shows a graphical or non-graphical progress indication similar to the
% standard WAITBAR function, but with the extra option of printing it in the command
% window as a plain text string or as a rotating dial. Alternatively, you can also
% specify it not to give feedback on... |
09a4f0d43824d76d7b99092f72a440d34a50e282437ba1de55ae98403b9098a3 | MATLAB | 11,691 | 277 | % computeLegFictracEphysIinj_1Fly.m
%
% Function that extracts the individual leg traces, FicTrac, and ephys in
% response to current injection of different durations and amplitudes for
% a single fly.
% User selects all pData for that fly through the file selection GUI
% Saves the data as a struct in path specifie... |
a329b0fffc7c19603dd3948a9a59e50a46d69b9c167858a458f3d70d3e0d493d | MATLAB | 11,693 | 269 | function fH = makeSupplFigure3_SimulateModelPredictions(saveFigs,saveFigDir)
% Function to reproduce supplementary figure 3:
% panel B: Simulate neural and BOLD predictions by pRF models
%
% From the paper:
% Title: Rethinking simultaneous suppression in visual cortex via
% compressive spatiotemporal populat... |
afc6c39eb788c4b4fc7d36bc39bbfbdda658f41d5645d69fd75462d30817f4a3 | MATLAB | 11,697 | 287 | % Fig 7. Benchmarking analysis results for data levels (i.e., data averaging)
% 7c. Binary Classification
% 7c-1. Benchmarking for train data levels
% 7c-2. Benchmarking for test data levels
% 7c-3. Benchmarking for test data levels (matched data)
% 7d. Regression
% 7d-1. Benchmarking for tr... |
03f8fcf8c966ca8892c0b74e6ac822da46ca5db04d8cb06c418cc133bd78d6eb | MATLAB | 11,704 | 222 | function [U] = hfmm3d(eps,zk,srcinfo,pg,targ,pgt)
%
%
% This subroutine computes the N-body Helmholtz
% interactions and its gradients in three dimensions where
% the interaction kernel is given by $e^{ikr}/r$
%
% u(x) = \sum_{j=1}^{N} c_{j} \frac{e^{ik\|x-x_{j}\|}}{\|x-x_{j}\|} -
% v_{j} \cdot \nabla \le... |
38dec7ee94338f639f5c84fe9ea350eb04290127f5c9ad93ef0df37581ecfde6 | MATLAB | 11,707 | 417 | function old_fmri_analysis(DATA,ROI,AddInfo)
%
% This Aedes plugin does a quick basic fMRI analysis.
%
if AddInfo.isDataMixed
% Make data a 4D-matrix if it is loaded in aedes as a stack of 2D or 3D images
DATA2{1}=DATA{1};
DATA2{1}.FTDATA = zeros([size(DATA{1}.FTDATA,1),...
size(DATA{1}.FTDATA,2),size(DATA{1... |
e6a0ae93856816a3100d8d4a29e84adad6421d43723d56e86e829f8338f119de | MATLAB | 11,732 | 274 | function plotRawDataStream( obj )
% plot LFP online streaming recordings: raw data or ECG cleaned data
%
% Syntax:
% PLOTRAWDATASTREAM( obj );
%
% Input parameters:
% * obj - object containg data
%
% Example:
% PLOTRAWDATASTREAM( );
%
% Available at: https://github.com/NCN-Lab/DBScope
% For referencing, please u... |
79c7d91a0fc8f3c917abe0320d72b7dead8836ebef33170f47e409e27d4d8ef0 | MATLAB | 11,740 | 327 | function [output]= event_classifier(starts,bin,param,ds_events,class_type,shuffle_yn,decay_yn)
% Description:
% Function that takes information from ds_events about the events and
% parameters about what should be classified and outputs how well the
% classifier does
% Inputs:
% starts = Points of time to cl... |
049570bd08190a47d676cbcfc46c771cdfffc23d97104154b2da393b6036cc64 | MATLAB | 11,743 | 339 | % plotCondBoutsStepParam_allFlies.m
%
% Function to plot 1D step parameters for bouts aligned to yaw velocity
% peaks. From output of saveLegStepParamCond_bouts()
% One figure with 6 subplots, 1 for each leg
% Can select more than 1 output file, will plot on same graph
% Has option to plot reference steps (from saveLe... |
f4805b66acc26c8ae3c82cd3d301c73be66662532c48ec3849aba9b76ee372be | MATLAB | 11,760 | 294 | % visstimLegFictracEphys.m
%
% Experimental Function
% For simultaneous presentation of visual stimuli on G3 panels and
% acquisition of leg video, FicTrac, and electrophysiology recording.
% Uses background acquisition on DAQ
% No current injection; use visstimLegFictracEphysIInj() instead
%
% INPUTS:
% settings -... |
d7d31d0d8bdd01dbe4897d708212ea277bdc53b950bed9a265ef5b1bd2acc9cd | MATLAB | 11,765 | 333 | function [ reject, dt, conv, fa, md ] = irlls( dwi, mask, g, b, sigma, options )
%IRLLS This functions performs outlier detection and robust parameter
% estimation for diffusion MRI using the iterative reweigthed linear
% least squares (IRLLS) approach.
%
% INPUT VARIABLES*
% dwi: [ndwi x nvox] or [n... |
e1eb22eca952fef08be016dc27495002b2d16c9f16e9343bd2ad5e77de916904 | MATLAB | 11,779 | 216 | function success = plot_image_directory(folder_name)
% plots the individual worm videos and all the track videos
addpath(genpath(pwd))
%% STEP 1: initialize %%
parameters = load_parameters(folder_name); %load experiment parameters
load('reference_embedding.mat')
number_of_images_for_median_projectio... |
7bab4d60a910b8631626e9ac69179b4b01ece0930e7af3bc5cc9b489fb67b9a8 | MATLAB | 11,788 | 220 | function [gp_vals, neur_vol] = setCellFluoresence(vol_params, neur_params, dend_params, neur_num, neur_soma, neur_num_AD, neur_locs, neur_vol)
% [gp_vals, neur_vol] = setCellFluoresence(vol_params, neur_params, ...
% neur_num, neur_soma, neur_num_AD, neur_locs, neur_vol)
%
% This function populates ... |
af1d004dbd77e628959753b365fd1016b14d4c591eb3cf935efdd0f0054620c2 | MATLAB | 11,864 | 236 | %%% demo of the full MIN1PIPE %%%
clear
warning off
gcp;
% To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary"
min1pipe_init;
addpath(genpath('../ANE'))
%% Set data and folder
patch_dims = [50,50];
list_Exp_ID = { 'c25_59_228','c27_12_326','c28_83_210',... |
0fab62f4a3f41be904bc71cc63f4c5fd2e5a0dcccc774303f2e80f4be18486d6 | MATLAB | 11,867 | 187 | %%%% CODE TO EXTRACT KILOSORTED UNITS/CLUSTERS AND IMPORT INTO MATLAB - WILL
%%%% EXTRACT ALL WAVEFORMS BUT ONLY PROCESS THOSE THAT HAVE BEEN
%%%% IDENTIFIED BY USER OR KILOSORT AS "GOOD" ISOLATED UNITS
%%% INCLUDES SEVERAL THIRD PARTY HELPER FUNCTIONS AVAILABLE FROM GITHUB AND MATLAB FILE EXCHANGE -
%%% LINKS TO... |
25cbf72d5820079f08f13d922d8ddbeab46db9e0f1ec0a132a7bc4fd313c8210 | MATLAB | 11,868 | 241 | %% clear the workspace and select data
warning off;
% gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
patch_dims = [50,50];
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_12... |
a5cd6cf0e3aa74a2a5141ddb1ca714342ef5ac52f79503e8b4e4f5f0b398de9d | MATLAB | 11,876 | 241 | %% clear the workspace and select data
warning off;
% gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
patch_dims = [160,160];
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)... |
0044a6da39e5f71866e40b5034822f7831f29e5189f46bfaade509aa31573802 | MATLAB | 11,877 | 270 | %Output results of F-test to a spreadsheet.
%
%EXAMPLE USAGE
% >> Ftest2xls(GND, 1, 'example.xlsx')
%
%REQUIRED INPUTS
% GND - A GND or GRP variable with F-test results
% test_id - The test number within the F_tests field of the GND
% struct
% output_fname - The filename fo... |
c5eaa81b049f8dd0ae1bd286194435fddb956363b6e4728ceeaf21953659d1db | MATLAB | 11,889 | 302 | classdef MLPipeline < handle
properties (SetAccess = protected, GetAccess = public)
RecordingsParentFolder
AnalysisParentFolder
Config
Experiment
% Kernel used to smooth the placemaps
SmoothingKernelSymmetric % Used for square and rectangular ... |
2ee1aa9dcab4abd54e40794d00f771dacbef79d1f92a907df767ab3462cb543b | MATLAB | 11,893 | 393 | function [suspicious,dataperfly,params] = suspicious_sequences(matname,annname,varargin)
[MINERRJUMPFRAC,CLOSELENGTH,MINORIENTCHANGE,MAXMAJORFRAC,MINWALKVEL,MATCHERRCLOSE,...
MINANGLEDIFF,MAXDISTCLOSEFRAC] = ...
myparse(varargin,'minerrjumpfrac',.2,'closelength',20,'minorientchange',pi/4,...
'maxmajorfrac',2/3,'... |
b36a6dc659164395697c1407631b1fef5404c03f3790c787af00691c4fe3b32a | MATLAB | 11,903 | 368 | function [err, v, Info, Com] = Read_1D (fname, p1)
%
% [err,M, Info, Com] = Read_1D (fname, [opt])
% or
% [err,M] = Read_1D (fname,[opt])
% or
% M = Read_1D (fname, [opt])
% or
% open a GUI file selector if no arguments are passed
%
%Purpose:
% Reads an AFNI 1D file into M
%
% The file is to contain an... |
28f546b16167a74a304a33dbe457cf5d6383610b4a7c8a1f854140eb59027d85 | MATLAB | 11,904 | 274 | % computeFreeWalkStepParameters.m
%
% Function that takes step indices [start, mid, end] and computes step
% parameters: step lengths, step directions, step durations, step speeds,
% step X velocities, step Y velocities
%
% Adapated from computeStepParameters(), but only computes step parameters
% relevant to free w... |
72ccbc748b273621667f3d1a0c4f3528c0bcc04239d587de8531e104a5a07f20 | MATLAB | 11,906 | 332 | function M = slmetric_pw(X1, X2, mtype, varargin)
%SLMETRIC_PW Compute the metric between column vectors pairwisely
%
% [ Syntax ]
% - M = slmetric_pw(X1, X2, mtype);
% - M = slmetric_pw(X1, X2, mtype, ...);
%
% [ Arguments ]
% - X1, X2: the sample matrices
% - mtype: the string indicating... |
8ee9f1aac4d6708b3d717d0dcabc43d7437367da4485d99eeb207a94b2c2f56c | MATLAB | 11,911 | 176 | % This script reads the data from paingen placebo study (demporaphic, behavioral and
% brain measures), and then runs mixed effects models for the placebo and stimulus intensity effects, accounting for the
% familial structure of the data (consisting of monozygotic and dizygotic twins).
%% read the data - CHANGE DIRS ... |
7c5419f5b319365e9d30062f5e6c30807007b57159a4742cb43e64edc2df445a | MATLAB | 11,916 | 294 | %function [Spikes, LFP, Theta, Head] = getSpikes(Session,MovieNum);
%
%gets all data from a section, defined by the Session and MovieNum
%
%Session, e.g.,'20150906Thalamus36'
%MovieNum, e.g., 63
%
%Spikes{Nunits}, cell holding spike times in ms from SessionStart
%LFP{Nchannels}, cell, holds LFP data in XXX unit... |
16f276d715f6d760805c46e827043a0effba80dbea698467408b71c992efaa44 | MATLAB | 11,919 | 303 | %Calculate F-observed and the empirical F-distribution for an ANOVA with
%one between subjects factor and up to two within subjects factors
%
%EXAMPLE USAGE
% >> [F_obs, F_dist, df_effect, df_res, exact_test] = perm_spANOVA(data, [16, 16], [3, 4], 1e4)
%
%REQUIRED INPUTS
% data - An electrode x time poi... |
2913c537bc5bcc2d3b443a41620884eb3f17c84842472088ddd44fb015a7f3fb | MATLAB | 11,927 | 307 | function compute_peak_difference_matrix(obj, session)
animalName = obj.Experiment.getAnimalName();
sessionName = session.getName();
sessionAnalysisFolder = session.getAnalysisDirectory();
% sessionName = session.getName();
% sessionAnalysisFolder = fullfile('R:\chengs_task_2c\data\minimice\feat... |
70c94f0ee7d3b20b4d6c63f1025ccc46f3693a9bc46d12aa6d45338877805887 | MATLAB | 11,933 | 307 | function compute_average_ratemap_difference_matrix(obj, session)
animalName = obj.Experiment.getAnimalName();
sessionName = session.getName();
sessionAnalysisFolder = session.getAnalysisDirectory();
% sessionName = session.getName();
% sessionAnalysisFolder = fullfile('R:\chengs_task_2c\data\mi... |
d6b398d37af39c5f3bcb447f4d7e9ebb8f4617d89d1c7706bd1db514fd37606d | MATLAB | 11,958 | 256 | %% Automated
% Load all data
% Find available datasets (always using dates as folders)
clear DateOpt
% %dd = arrayfun(@(X) fullfile(DataDir{DataDir2Use(X)},MiceOpt{X},'*-*'),1:length(MiceOpt),'UniformOutput',0);
DateOpt = arrayfun(@(X) dir(fullfile(DataDir{DataDir2Use(X)},MiceOpt{X},'*-*')),1:length(MiceOpt),'UniformOu... |
a4bbaaafeb1082dff224433869f27e669847673b972da78ad568da6ed3c86325 | MATLAB | 11,965 | 242 | %% clear the workspace and select data
warning off;
% gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
patch_dims = [160,160];
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)... |
d81e1cf3dfa683cc2595c5b06ee57c5ff20370fe55668c54b984d0d970cb712b | MATLAB | 11,965 | 317 | function [roi, sig, bg, bgf, idusef, datasmthf, cutofff, pkcutofff] = pix_select(m, mask, sz, Fs, sigthres, corrthres)
% select real seeds for downstream processing
% Jinghao Lu 05/20/2016
hpix = tic;
%% initialization %%
%%% initialize parameters %%%
if nargin < 3 || isempty(sz)
defpar = def... |
cefdca70d13f26be46d23fdd91857f5841823a83d037cbc146302d8b95778c08 | MATLAB | 11,974 | 307 | %% BEHAVIOURAL_ANALYSIS
% This script calculates and plots a variety of descriptional statistics
% based on the behavioral (motion) data. For instance, it can plot the walking
% speed during various conditions, calculates the average turn duration, or
% calculates at which point of the turn/doorway the FOG occured.
%... |
98f1e3c9380cfb27dbeb557e40e0749eb13f609aacb3bb3fb860dd545c137d47 | MATLAB | 11,979 | 259 | function [ status_timeline, status_events, status_events_FFT ] = fillChronicParameters( obj, data )
% Extract and visualize LFPs from chronic LFP data.
%
% Syntax:
% [ status_timeline, status_events, status_events_fft ] = FILLCHRONICPARAMETERS( obj, data );
%
% Input parameters:
% * obj - object containg data
% ... |
630462412007840e9543a28fa085620fe3aede862565ce5facb800c42e1b6218 | MATLAB | 11,980 | 335 | % findOptomotorCondYawVelPeaksFT.m
%
% Helper function for extractOptomotorBoutsLegStepParams_fly() that takes
% in fictracSmo, cond, fwdVelCond, moveNotMove, visstim, boutTimeWin,
% pkTimeRelOpto, and
% returns times for valid yaw velocity peaks as well as start/end times
% for corresponding bouts.
% Boolean for... |
e4f8a6572e0fe849f0b7fef3f3c6f5a6fcc31fe7e72afcfd3bb487d426661a8a | MATLAB | 11,981 | 307 | % plotAEPPEPscatter.m
%
% Function to plot 2D scatterplot of all leg step AEPs or PEPs (user
% specified), colored by specified conditions (iInj or opto).
% Works on multiple pData files. Select through GUI. Should be for 1 fly.
%
% INPUTS:
% whichEP - which extreme position to plot (AEP or PEP), specified as
% ... |
6c339545b7aa002dcb11d2e44f9f71347447ad9273d82e8e4be1d1f96be5db73 | MATLAB | 11,988 | 271 | function [file_name_to_save, filename_raw, filename_reg] = min1pipe_h5_vary(...
path_name, folder, filename, Fsi, Fsi_new, spatialr, se, ismc, flag,...
pix_select_sigthres, pix_select_corrthres, merge_roi_corrthres, dt, kappa)
% main_processing
% need to decide whether to use parallel computing
% Fsi: raw s... |
59e86098f4fc5dcba699dba0bed78ec9ffd75b70538f9064f3802684d18540df | MATLAB | 11,991 | 310 | % getCorrelationEphysContParam_cond.m
%
% Variant of getCorrelationEphysContParam() (description below) but it also
% allows conditioning one or more specified parameters (FicTrac,
% legStepsCont, or binary for whether step is moving forward or
% backwards).
% Function to extract correlation between spike rate or me... |
12f5ff1d2f24a872187b8ceb06dff2d31024ca17d932542ae31bedeaa818e799 | MATLAB | 12,007 | 188 | function [vibration_transition_rate_of_interest,control_transition_rate_of_interest,vibration_transition_rate_of_interest_std,control_transition_rate_of_interest_std,h,p,tap_transition_total_count,control_transition_total_count,vibration_observation_total_count,control_observation_total_count] = average_transition_rate... |
da4d48ff872115a2165f88c025fa15608b7cc500ac11b916d18ddc0f91ff6478 | MATLAB | 12,013 | 192 | function [tap_transition_rate_of_interest,control_transition_rate_of_interest,tap_transition_rate_of_interest_std,control_transition_rate_of_interest_std,h,p,tap_transition_total_count,control_transition_total_count,tap_observation_total_count,control_observation_total_count] = average_transition_rate_after_tap(folders... |
2b19e4f80a1f6f818da9df3d0a84b9c635b71782aa97c1bf72a415d15f3ffee8 | MATLAB | 12,018 | 289 | %% User Input
NewHistologyNeeded = 0; %Automatically to 1 after RedoAfterClustering
RedoAfterClustering=0;
RedoUserInput = 0;
% directory of reference atlas files
ann = 10; %Steps in micron that's used
annotation_volume_location = 'annotation_volume_10um_by_index.npy';
structure_tree_location = 'structure_tree_safe_20... |
39799e330568e7a9e959c781b1d6dae90f8e3c0a2999b0ccda2b8768b26743e2 | MATLAB | 12,043 | 322 | function t_elapsed=drawSlidingWedges( stimDuration, ...
wedgeRadialCoords, ...
wedgePolarCoords, ...
wedgeRadialWidths, ...
wedgePolarWidths, ...
minEccentricity, ...
maxEccentricity, ...
wrapEccentricity, ...
checkSizes, ...
wedg... |
9788dffc06ab882fac2ecc7ec09a65ff0c1c0fce7f70178b4a0fd4b5b12fbc55 | MATLAB | 12,065 | 210 | %% Neurofeedback: main ripple quantifications; pre vs plateau, EXCLUDING TRIGGER
% Figure 1 & SupFig 1
animals = {'remy','gus','bernard','fievel'}; %,'gerald'};,'jaq','roquefort','despereaux','montague'
% this onlu makes sense to do in plateau phase
epochfilter{1} = ['isequal($cond_phase,''plateau'') & (isequal($env... |
9e4cd66660d97269923fba7fa55b06f6fbe974464fc847a4a74f4127a2be2fb9 | MATLAB | 12,072 | 358 | function [E, D] = pcamat(vectors, firstEig, lastEig, s_interactive, ...
s_verbose);
%PCAMAT - Calculates the pca for data
%
% [E, D] = pcamat(vectors, firstEig, lastEig, ...
% interactive, verbose);
%
% Calculates the PCA matrices for given data (row) vectors. Returns
% the eigenvector (E) and diag... |
4e12a5b27c3e777230e4611f3644db4d826bf5432dec9a92b283ac2ac0cb7fb5 | MATLAB | 12,073 | 386 | function icassoGraph(sR, varargin)
%function icassoGraph(sR,['identifier1',value1,'indentifier2',value2,...])
%
%PURPOSE
%
%To visualize the estimate space as a 2D projection and the
%similarities between the estimates as a graph. Estimates are
%presented as black points that are located so that the distances
%between ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.