sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c418271f1b0291d3c0eef200be54215eb67e6f9d94cb813a6ca11cf5295ca7d4 | MATLAB | 3,016 | 125 |
function cnn_save_model(epoch_dir, net_config_input, exp_info)
if ~isempty(net_config_input)
net_config=gen_saved_net_config(net_config_input);
net_filename=net_config.ref.cache_filename;
net_config.ref.cache_filename=[];
net_config_file=fullfile(epoch_dir, net_filename);
fprintf('save net_confi... |
04dbc7dfc95076ea65991a8455cc55dddc465bab7e30ce5078d143a1e482f5c8 | MATLAB | 3,018 | 83 | function parameters = LoadParameters(filename)
%LoadParameters - Load parameters from an XML file.
%
% USAGE
%
% parameters = LoadParameters(filename)
%
% filename parameter file name
%
% This is a slightly modified version from the original: it also contains
% calibration information in the output, ... |
27616121b455dcd149a725b9876f4c2ad0ece95f5137143e24ca4a06a2f2c157 | MATLAB | 3,019 | 87 | % firwsord() - Estimate windowed sinc FIR filter order depending on
% window type and requested transition band width
%
% Usage:
% >> [m, dev] = firwsord(wtype, fs, df);
% >> m = firwsord('kaiser', fs, df, dev);
%
% Inputs:
% wtype - char array window type. 'rectangular', 'bartlett', 'hann',
% ... |
9c92cd3c205f2575242957bdab32b3a78b581f31e3e449435be1adfa377549aa | MATLAB | 3,019 | 76 | % getLegReversals.m
%
% Function for getting max and min in leg positions, when leg reverses
% direction
% Adapted from nonInteractGetLegReversals(), but uses findpeaks to get leg
% reversals instead of findLegReversals()
%
% INPUTS:
% legTrack - struct of leg tracking data, output of preprocessLegTrack
% moveNo... |
7b99384d7e7e0d9b876ee51027a70c427ddbed90912ef597cb35bfb86051e69f | MATLAB | 3,021 | 67 | % mglDescribeDisplays: Retrieves information about available displays and
% basic computer info.
%
% $Id$
% usage: mglDescribeDisplays
% by: Christopher Broussard
% date: 10/27/07
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Retrieves information abo... |
66a1559482de5da3ca679550a032c06e415948506e7a7709b4468b10aec9f828 | MATLAB | 3,022 | 96 | % this script takes in a M3BA module and varies it's staggering until the
% modules are adjacent to their original neighbors. The number of channels,
% brain sensitivity, and spatial multiplexing groups are saved
clear all
probe.module = createModule(4, 42);
y1 = 10; pos = 14;
probe.module.srcposns = [pos, pos; -pos,... |
9bb27831bc9ff410e32b776736b0bc468f4ec07e630043ea03fdcdeb1bfcef9c | MATLAB | 3,022 | 78 | clear
cd ./uncertain-cuelight
% C1S2:loop;C1S3:go cue;C1S4:go judge;C1S5:no gocue;C1S6:nogojudge;
% C1S7:go Hit;C1S8:go miss;C1S9:no go CR;C1S10:airpuff;OUT1:reward;OUT2:airpuff;
% C1S11:reward omit;C1S12:unceud reward; OUT5:light
control=dir('C*.mat');
inhibit=dir('I*.mat');
performence=[];
for i=1:length(cont... |
d2023d6262bf4997b45d51ddc16b3eb4a38eb6d09203d6fb3e87321ef8e29b10 | MATLAB | 3,022 | 78 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R, success] = compute_normal_bfo180_similarity_table(PerCell180, BFO180_FILTER_MIN_MAPS, BFO180_FILTER_MIN_TRIAL_CORRELATION)
PerCell180.animalSessionCellId = nan(size(PerCell180,1),1);
%PerCell180.animalAnimalSess... |
36947b37fccd4faa64080f7d46469af261cc28b5085992896b0caa653934d9a7 | MATLAB | 3,024 | 80 | %% Recording algorithm behavior with MatlabBGL
% In this example, we will write a simple visitor that outputs an
% algorithm's behavior. The algorithm we will examine is dijkstra_sp. To
% examine the runtime behavior we will use a visitor which outputs a string
% every time a function is called.
%% Setup
% To begin... |
5ddc3fbea4931a04138e1755b995bbefa4cdd9063e495a122044cdd1fc623c11 | MATLAB | 3,024 | 83 | function img_out = blurredBackComp2(TMPvol, idx, psf_lowres, pwr_ratio, mask, freq_opt, zscale, varargin)
% function img_out = addBlurredBackground(TMPvol, idx_top, idx_bot, psf_lowres, pwr_ratios)
%
% Create the background image adding in the
%
% 2018 - Adam Charles and Alex Song
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
eb918966fab0832e18bebe45b8d4b883141ed244df85a7df65f6feb58c57e124 | MATLAB | 3,025 | 108 | function [colourIm colourImUInt8] = Image2ColourSpace(im, colourType)
% Changes the colourType of an image
%
% im: Image, double or UINT8, grayscale (size(im,3) == 1) or Rgb
% colourType: String denoting colourType. Possibilities:
% - Rgb (no change)
% - Hsv
% - H, ... |
531f5683a13fe4750ccc0798b25d8291deeb30e5c6b9c060d8102dfdca90b6fe | MATLAB | 3,027 | 97 | % mglMetalOpen: Open an mgl metal window (starts a separate standalone app which
% mgl communicates with via a socket). Typically called from mglOpen
%
% usage: mglMetalOpen(whichScreen, screenX, screenY, screenWidth, screenHeight)
% by: justin gardner
% date: 09/27/2021
% copyright: (... |
c028690b8d95c39cfd40d692767bb2619a02b842774062502038721cf0d636b7 | MATLAB | 3,027 | 131 |
Fig2Vars = {
% Var %N
'theta.Rset' %22 VPM28 12,2; POm39 7,1
'theta.L' %19 VPM28 2,2; POm40 12,2
% 'allo.R' %18 VPM28 12,3 POm44 2,1
% 'allo.Rv' %14 VPM28 6,2 POm40 12,2
'theta.Rv' %14 VPM28 12,3 POm40 12,2
'theta.Rphase' %15 ... |
b550738a6e01c4fbbb5d82cc404233ef0d8cd75dab446df0edba98724dde0008 | MATLAB | 3,030 | 78 | clear
cd ./uncertain-responselight
% C1S2:loop;C1S3:go cue;C1S4:go judge;C1S5:no gocue;C1S6:nogojudge;
% C1S7:go Hit;C1S8:go miss;C1S9:no go CR;C1S10:airpuff;OUT1:reward;OUT2:airpuff;
% C1S11:reward omit;C1S12:unceud reward; OUT5:light
control=dir('C*.mat');
inhibit=dir('I*.mat');
performence=[];
for i=1:length... |
315537dfcc1fdae741202e9acf14750c4c468c10cb00a37bf6832ec7a2ed34a3 | MATLAB | 3,033 | 105 | function varargout = armorf(x,Nr,Nl,p)
%ARMORF AR parameter estimation via LWR method by Morf modified.
% x is a matrix whose every row is one variable's time series
% Nr is the number of realizations, Nl is the length of every realization
% If the time series are stationary long, just let Nr=1, Nl=length(x)
% ... |
37b5ff6ac42ebb4d998f522d5551732092d89aa5459bbf2020a82dc04294fff8 | MATLAB | 3,034 | 94 | function [S,gammas]=linearSamples(A,n,varargin)
% linearSamples Compute multiresolution ensemble using linear sampling.
%
% Syntax
%__________________________________________________________________________
%
% [S,gammas]=linearSamples(A,n)
%
% [S,gammas]=linearSamples(__,Name,Value)
%
%
% Description
%____________... |
80009890192a953ed136cbdaf1297f184b524bd945ed275cccf0168f15212d43 | MATLAB | 3,036 | 82 | function [Percentage, reversal_counts, frame_count]= ReversalPercentage(folders, Tracks, frames)
%not used in paper
fps = 14;
allTracks = [];
relevant_fields = {'Frames','Pirouettes'};
if nargin < 1 %no folders are given, ask user to select
folders = {};
while true
folder_na... |
eea17f4c5b9122c8d4556b60299e04f174773c1ff2a7183702b889d8f6f831a6 | MATLAB | 3,038 | 80 | function numbers = ft_poll_buffer(filename, thresholds, timeout)
% FT_POLL_BUFFER polls the FieldTrip buffer described by 'filename' for
% the number of events and samples. You can also use this function to
% wait up to a given amount of milliseconds until the number of samples
% OR the number of events present in the ... |
da0d73bc5c8256ce81beaa6353ef84d4fab7310683c9ec51593402abb97a272d | MATLAB | 3,043 | 102 | classdef DAQSettingsAndNotes < handle
properties (SetAccess = private)
animal;
excitation;
msCamExposure;
recordLength;
elapsedTime;
note;
end % properties
methods
function obj = DAQSettingsAndNotes( filename )
if nargin ~= 1
... |
d1fd677170bf57b8b52e23c73fb111546102f7da6dba22545f4ebcb8e7aa0030 | MATLAB | 3,045 | 91 | % ephysGetSpikes_all.m
%
% Function that detects spikes, computes spike rate, and computes
% median-filtered voltage trace on each preprocessed ephys trace. Runs on
% selected pData files. Must have run preprocess() before running this.
%
% INPUT:
% none, but prompts user to select pData file(s)
%
% OUTPUTS:
% no... |
141bfd01fb7c8ea0452ef6699904ebc77ef17939393ae008b4b5285b9f05c5fa | MATLAB | 3,048 | 67 | function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin)
%
% Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the gap between
% neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functionality... |
a016008f9e7b1bbd7b4ecac87d2e92ee43fbb42a36a44b31cc8e9eed85293cf8 | MATLAB | 3,048 | 60 | function Uout2 = generateBA(vol_params,psf_params)
% Uout2 = generateBA(vol_params,psf_params)
%
% This function generates a Gaussian back aperture intensity profile with
% the specified aberrations applied. The inputs are
%
% - vol_params - Struct with parameters for the volume generation
% .vol_s... |
1e4a25c003c8a681dbce1f08db2847e0c324ef876633cb02f80e4535f499059a | MATLAB | 3,049 | 152 | %% TRACKING PARAMETERS
clearvars -except X Y ExpList OutList ExpName OutName ReferenceList ZoneMaster Range;
sizes = [140 320];
erode = 2;
sens = 0.29;
%sens = 0.4
fsize = 0.5;
framelimit = 4;
FR = 10;
file_name = ExpName;
output = OutName;
v = VideoReader(file_name);
%FR = v.FrameRate
mkdir(output);
addpath(ge... |
3dd79fb67fd86c55a85649b1ccfaf587536c989546835058e8eabede277d0f17 | MATLAB | 3,049 | 65 | function feat = extr_feat_arbitraryRegions(chns, pixels)
imsz = chns.imh * chns.imw;
feat.colorArr = zeros(24, 1);
feat.colorArr(1) = mean( chns.rgb(pixels) ); feat.colorArr(2) = std(chns.rgb(pixels), 1);
feat.colorArr(3) = mean(chns.rgb(pixels + imsz) ); feat.colorArr(4) = std(chns.rgb(pixels + imsz), 1);
... |
405e672bee89fcf7d512f1e2c947c1b66643891ab0ff6753cf8dfa5d958ef47b | MATLAB | 3,051 | 123 | function [pos, mom, ampl, time] = read_asa_dip(fn);
% READ_ASA_DIP reads the dipole position, moment and amplitude
% This importer is designed for fixed-dipole models and only supports
% a limited number of the options that ASA has.
%
% Use as
% [pos, mom, ampl, time] = read_asa_dip(filename)
%
% See also READ_ASA_... |
0b7c26170f653672e5c2102e4439fe3b4323ada32caa913ede39803d7c505364 | MATLAB | 3,053 | 98 | function status = besa_save2Elp(file_path, file_name, ...
spherical_coordinates, channel_labels, channel_type)
% BESA_SAVE2ELP writes a matrix of spherical coordinates into ASCII file
% in the ELP-format.
%
% Parameters:
% [file_path]
% Full path to the folder where the file should be saved.
%
% ... |
e5cb83b20e11792aebbfc472568260d1a09955ac93ec78e11a1e86cf1894be63 | MATLAB | 3,053 | 91 | % getDFFfromBouts.m
%
% Helper function for saveDFFCond_bouts() that takes in dF/F and bout times
% and returns the dF/F values aligned to the velocity peak
% To allow averaging over different bouts and the inconsistent frame rate,
% interpolate to specified frame rate
%
% INPUTS:
% dff - struct of imaging data, fr... |
c30342b407bb9bfd610f84b74154b269bfb142f311174dccfa23af88cb800168 | MATLAB | 3,058 | 114 | %
% Draw one degree distribution.
%
% When the two last parameters are not given, the gamma plot is not drawn.
%
% PARAMETERS
% a The adjacency matrix. The left distribution is taken out of it.
% power The gamma exponent, NaN when no exponent is drawn
% xmin The xmin to show; NaN to not show it
% pvalue ... |
c351c750c36e48d112fbbc3824228ff9e89ee64f8882c4fae3a11092589eb90b | MATLAB | 3,058 | 78 | % fccAlignment.m
%
% Perform alignment of image sequence to reference image based on
% maximizing image crosscorrelation in Fourier space.
% Same code as fourierCrossCorrelAlignment.m (provided by Marion Silies),
% except only the alignment part.
%
% INPUT:
% imageArray - 3D array, corresponding to height x width... |
dda6490dfe2a587b9bc5ba76be5bd95e1e1354c3712d7d7d4ee3d6c6deccfefb | MATLAB | 3,061 | 84 | function [vars, trackParams, frameData] = manualFrame_APP(app, vars, trackParams, frameData, frame)
%% Set up Figure
manFig = figure()
manualFrameFig = tight_subplot(2,1,[0 0],[.0 .02],[0 0]);
subplot(2,2,3)
[previousImage] = readImg_APP(trackParams.imAdjust, trackParams.cam, frame-1);
imagesc(previousImage); colorm... |
5617dcafa18e527e658d366ccb6a0be09d1e0dbd34444d657e3b35fdb6a94e14 | MATLAB | 3,062 | 88 | % cleanLegVidDat.m
%
% Quick function to go through all date folders preprocessed on or before
% 2/25/19 to fix error in getting vidName. Was saving hidden files like
% ._legVid.mp4 as the legVid name instead of legVid.mp4. Fixed in
% preprocessLegVid.m on 2/25/19
%
% CREATED: 2/25/19 HHY
%
function cleanLegVidDat... |
d1534b277ac07c1cf635a1d466603900683ae5503f612c530b845515548f926f | MATLAB | 3,062 | 107 | function [] = ExtDataFig07_SongTypeRespDiffHist()
% Code for plotting the histogram of the mean difference in ΔF/F between pulse and sine song during song-type transitions for the voxels which changed ΔF/F depending on song type in Extended Data Fig. 7k,m.
GT = 'nsybDnonfru'; % Extended Data Fig. 7k
% GT = 'nsybnonfru... |
8fe729ef801c2f98dcf7383c1967b1048715614d97e7488473aee1eeab2d3d03 | MATLAB | 3,063 | 84 | % mergeAdjVecVals.m
%
% Function that takes in vector with a sequence of numbers that are
% sometimes consecutive and sometimes not and returns the values in the
% original vector at the start point and end point of those sequences and
% the corresponding indicies into the original vector.
%
% INPUTS:
% seqVec - v... |
587d68856a586346eba5648f47d223f014540f3f37cc9ed835f5cc4f8114fb1c | MATLAB | 3,064 | 116 | function [f] = oeFilter(sigma,support,theta,deriv,hil,vis)
% function [f] = oeFilter(sigma,support,theta,deriv,hil,vis)
%
% Compute unit L1-norm 2D filter.
% The filter is a Gaussian in the x direction.
% The filter is a Gaussian derivative with optional Hilbert
% transform in the y direction.
% The filter is ze... |
8de80320a5744e439b6119f1601ec7c057bb3e662e11a3d913d5ba28c8ec1afa | MATLAB | 3,064 | 114 | %% Analyze simulation results
clear
restoredefaultpath
filePath = matlab.desktop.editor.getActiveFilename;
root0 = fileparts(filePath);
addpath(genpath(fullfile(root0,'lib')));
root = fullfile(root0,'data');
%% Karger model fitting
load(fullfile(root,'simulation_results_fix_two_tex.mat'));
tex_fit = zeros(2,2); % 2 C... |
32f5b164f730cfa382f40e41897544ec2a18951682818c9040b5cb6fe7b2634e | MATLAB | 3,065 | 66 | %% Written by Eric Earl, 10/15/2014
function subject_motion_numbers_TXT_parse_BIDS(movement_files, output_dir, output_prefix)
% Motion numbers parsing Nipype wrapper pulling in list of motion files
% Outputs motion_numbers to "motion_numbers.mat" file
% movement_files = {'motion_numbers0.txt', 'motion_numbers1.txt', 'm... |
681578a11b1d3f03f32045a4503307317f801554c0b687519df5f6bbca81a7fa | MATLAB | 3,065 | 91 | function plotRawDataSurvey( obj, varargin )
% PLOTRAWDATASURVEY
% Plot Survey LFP recordings raw data
%
% Syntax:
% PLOTRAWDATASURVEY( obj, varargin );
%
% Input parameters:
% * obj DBScope object containg streaming data.
% * (optional) ax Axis where to plot.
% * rec Index of rec... |
ec40acfaff77387ac8b7b5c4d49089d018bb2be13fe6a4cab3dddeb9aaeda2ba | MATLAB | 3,065 | 82 | function[unsuccessful]=find_misclassified(cluster_outcome,errors,titlestr,figyesno)
% function to look at silhouette scores of data for clustering combinations
% that only had x amount of misclassified cells
overall_score=nan(length(cluster_outcome),1);
success=nan(length(cluster_outcome),1);
clength=nan(length(cl... |
a755c463d07be48a0828573fb4aa86a432f18f8e4468e5a63784f72ea3363119 | MATLAB | 3,067 | 69 | clear, clc;
surfpath = '/media/data2/Epilepsy_Shape/Templates/Shape_Surf';
volpath = '/media/data2/Epilepsy_Shape/Templates/Shape_vol';
test_surf = [surfpath, '/atlas_AllSubcortical.surf.gii'];
surfinfo = gifti(test_surf);
coord = surfinfo.vertices;
%% using iso2surface toolbox to create the correponding volume imgae... |
beeee9ad1a25c2f6253f6b91a73e367c7fbbb69fc242123bc406ec36c07940dd | MATLAB | 3,067 | 105 | % plotMeanAutoCorr.m
%
% Function to plot all autocorrelations. Also shows
% number of flies in figure legend. Produces 1 plot, with subplots.
% Plot autocorrelation with (+) and (-), though symmetric.
% Requires the structs generated by extractKernels()
%
% INPUT:
% autoCorr - autocorrelations struct from extractKe... |
d544028445369e5fca259d1a225d72a0e740199b5f15a6cab42569331f1195e5 | MATLAB | 3,067 | 87 | function build(debug)
%% validate input
currentFileLocation = fileparts(mfilename("fullpath"));
flags = {'-largeArrayDims', "-outdir", currentFileLocation};
cleanup = true;
if nargin >= 1 && logical(debug)
flags = [{'-v'}, flags];
cleanup = false;
end
%% variables
c... |
40519095afdccda418f1778050d05d689d16afc25f77918d41f9e40483aeff5a | MATLAB | 3,068 | 94 | function [S,gammas]=exponentialSamples(A,n,varargin)
% exponentialSamples Compute multiresolution ensemble using exponential sampling.
%
% Syntax
%__________________________________________________________________________
%
% [S,gammas]=exponentialSamples(A,n)
%
% [S,gammas]=exponentialSamples(__,Name,Value)
%
%
% ... |
6be7be46f2951d20786834e829e4eedd97b29dc5314036c51c5d8663c04d86d9 | MATLAB | 3,068 | 105 | % plotMeanAutoCorr.m
%
% Function to plot all autocorrelations. Also shows
% number of flies in figure legend. Produces 1 plot, with subplots.
% Plot autocorrelation with (+) and (-), though symmetric.
% Requires the structs generated by extractKernels()
%
% INPUT:
% autoCorr - autocorrelations struct from extractKe... |
26071faaf907750f033b7bb7356585b7cb623597bde5f0184a143d8869a6f9ed | MATLAB | 3,069 | 57 | % Get header of the system information
% [ Yokogawa MEG Reader toolbox for MATLAB ]
%
% brief:
% This function retrieves information about coregistration in the specified file.
%
% usage:
% coregist = getYkgwHdrCoregist(filepath)
%
% arguments:
% filepath : file path
%
% return values:
% coregist : ... |
2bcece355bf39cac7574ec7a704d8f74ab6ca5401624e78e2849055d13cef376 | MATLAB | 3,079 | 100 | function [hdr, dat] = read_neurosim_signals(filename)
% READ_NEUROSIM_SIGNALS reads the "signals" file that is written by Jan
% van der Eerden's NeuroSim software.
%
% See also FT_READ_HEADER, FT_READ_DATA
% Copyright (C) 2012 Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fie... |
60ebabbb0eb9236e0473aacdd8407280bf9ee8c416d5ed36bc6420a9ab75e330 | MATLAB | 3,081 | 77 | function [myscreen] = eyeCalibrationEyelink(myscreen)
% eyeCalibrationEyelink - initializes a the myscreen and tracker for use
%
% $Id: eyeCalibrationEyelink.m 203 2007-03-19 15:41:00Z justin $
% usage: myscreen = eyeCalibrationEyelink(myscreen)
% by: eric dewitt
% date: 2009-03-10
% copyrigh... |
cf531b1fe4848b95b79e5657d7fa9bbc37a49d7594f01b464c4b2727805adc3f | MATLAB | 3,083 | 78 | %% SRIRAM MULTI ARRAY FIGURE SCRIPT - AUGUST 29 2018
%% Read from Recording Segment
clear;clc;close all
%cd Z:\1_Maxwell_Gagnon\ProjectData_Sriram\Granule_cell_recording\NR2_F_10_S1
%cd('C:\Users\maxwellg\Desktop\Sriram Nov CG Recording')
cd('C:\Users\maxwellg\Desktop\290119-selected COPY')
seg_file_names = dir;
%seg_... |
f142412549efdab3a8a121584652f11f4910d8739a9b10c3f2f177ad965c44d8 | MATLAB | 3,083 | 70 | function [tpt_acu_m, seed_size] = run_VR(nseeds, data_run)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 (20... |
ffcef94b123d7822bb689e8835d3cc478863bf164f976599550559b548a83099 | MATLAB | 3,083 | 57 | % Profile Likelihood Generator edited for GBM model
% Original Source: Marisa Eisenberg (marisae@umich.edu)
function profile = GBMProfLike(params,profindex,costfun,factor,numpoints)
% Definitions
% params = point in parameter space from which to profile (the parameter estimates)
% profindex = index of the paramete... |
b053ea24ea2b3e3122a8598451e7030700a78a4e4a7f26504067052c08757875 | MATLAB | 3,084 | 115 | function [b0, dt, md, rd, ad, fa, fe] = dti_fit(dwi, grad, mask)
%% check grad order
bval = grad(:, 4);
order = floor(log(abs(max(bval)+1))./log(10));
if order >= 2
grad(:, 4) = grad(:, 4)/1000;
bval = grad(:, 4);
end
%% parameter checks
dwi = double(dwi);
... |
d2ca2beee8ac51f18fcbd718a312b281fb25ae837371d5940f25b2b59584d670 | MATLAB | 3,085 | 64 | function verifyContainerEqual(testCase, actual, expected, ignoreList)
if nargin < 4
ignoreList = {};
end
assert(iscellstr(ignoreList),...
'NWB:Test:InvalidIgnoreList',...
['Ignore List must be a cell array of character arrays indicating props that should be '...
'ignored.']);
testCase.verifyEqual(class(... |
4766a9c17342179f1e51927dc35c9e91f7a5e6654be347870377283038faa354 | MATLAB | 3,086 | 99 | % Demo of data preprocessing for rotational velocity (Rot. Vel.) profile
% using conjugate axis transformation, peak shifting and replicated padding
%
% Example input profile: 101*3, where 101 is the temporal length of the
% profile(from 0 to 100 ms, 1 sample per ms),3 is the time-varying velocity
% compone... |
def1ea75c56c5c80b164197d59f8d653593998cf7a47ecb42e049ba6230e5660 | MATLAB | 3,086 | 69 | classdef CBIG_MMLDA_unit_test < matlab.unittest.TestCase
% Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
methods (Test)
function test_example(testCase)
% This is temp cmds for freeview 7.4.1
[status, ~] = system('timeout... |
e0c6df33fc32a6a90544ea2f1598ddfcedf79fbc2bbdde764b65ac7f4712a753 | MATLAB | 3,086 | 117 | % plotPairCorrContParamEphys_fly.m
%
% Function to plot correlation coefficient between ephys and behavior,
% paired by same fly, 2 conditions. Operates on output of
% getCorrelationEphysContParam_cond_all().
% Prompts user to select output files 2x, one for each condition. Assumes
% output files for same fly sele... |
eebb4f777bf60de1edacfa15087f4881b2316816e0683b3d7484b46414c64d0a | MATLAB | 3,086 | 77 | function [myscreen] = eyeCalibrationEyelink(myscreen)
% eyeCalibrationEyelink - initializes a the myscreen and tracker for use
%
% $Id: eyeCalibrationEyelink.m 203 2007-03-19 15:41:00Z justin $
% usage: myscreen = eyeCalibrationEyelink(myscreen)
% by: eric dewitt
% date: 2009-03-10
% copyrigh... |
2dcf44cf3108a7df59268db483da2840069e92cb0f5ed0590dd3d221a7e4c3c9 | MATLAB | 3,089 | 88 | function VarName2 = import_masked_tc(filename, startRow, endRow)
%IMPORTFILE Import numeric data from a text file as column vectors.
% VARNAME2 = IMPORTFILE(FILENAME) Reads data from text file FILENAME for
% the default selection.
%
% VARNAME2 = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads data from rows
% STAR... |
36a6180ac194dd94fa53619858fc0f0a36d831cd4366db745113ffe0cd11b9eb | MATLAB | 3,090 | 92 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [hFig] = stabilitybfo90table_percell_plot_withinacross_prob(groupLabels, StableMeanTable, StableErrorTable, UnstableMeanTable, UnstableErrorTable, showExcluded)
numGroups = length(groupLabels); % should be a cell arr... |
5d40a137c54720302ddcdc85bc8072a0e1314091f4292f655725285afb4b9f48 | MATLAB | 3,090 | 136 | #!/bin/bash
#SBATCH --time=48:00:00
#SBATCH --job-name=FCGenerationCNT
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem=3G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-50
#SBATCH --output=outputs/FC_CNT_A%A_%a.out
#SBATCH --error=outputs/FC_CNT_A%A_%a.err
#Load Matlab 2017a module
ml MATLAB
matlab -nodisplay... |
7bb77b94393a206af68345d26443905ed4cbb395d7f36da014733562b078588a | MATLAB | 3,090 | 136 | #!/bin/bash
#SBATCH --time=48:00:00
#SBATCH --job-name=FCGenerationUWS
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem=3G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-50
#SBATCH --output=outputs/FC_UWS_A%A_%a.out
#SBATCH --error=outputs/FC_UWS_A%A_%a.err
#Load Matlab 2017a module
ml MATLAB
matlab -nodisplay... |
af1b12e3d5354c66a18f9c5a122fe08702e2b4a1a1f261e1bca1a1b16d37045c | MATLAB | 3,090 | 99 | function [val] = filetype_check_header(filename, head, offset)
% FILETYPE_CHECK_HEADER helper function to determine the file type
% by reading the first number of bytes of a file and comparing them
% to a known string (c.f. magic number).
% Copyright (C) 2003-2006 Robert Oostenveld
%
% This file is part of FieldTrip,... |
c1b0454449e5b41f3c2958895f4870e2f61433e62fb1f2e8daa57525bc0982d2 | MATLAB | 3,090 | 136 | #!/bin/bash
#SBATCH --time=48:00:00
#SBATCH --job-name=FCGenerationMCS
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem=3G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-50
#SBATCH --output=outputs/FC_MCS_A%A_%a.out
#SBATCH --error=outputs/FC_MCS_A%A_%a.err
#Load Matlab 2017a module
ml MATLAB
matlab -nodisplay... |
6c7c201de21c167564a29122db9ce02905eb79688efd1217fee0647d106ba46d | MATLAB | 3,093 | 80 | function [backpanel, frontpanel] = read_ctf_trigger(dataset)
% READ_CTF_TRIGGER reads the STIM channel from a dataset and detects
% the trigger moments and values
%
% [backpanel, frontpanel] = read_ctf_trigger(dataset)
%
% This returns all samples of the STIM channel, converted to backpanel
% and frontpanel trigger v... |
1dc7f1bd5450c5e9c0947fd73b748aa48bd6ffc4286c370291e708a7ab5c1045 | MATLAB | 3,095 | 116 | %
% Draw one fitting curve.
%
% PARAMETERS
% curve Name of curve
% mi,ma Min and max values on the X axis to draw
% a Eigenvalues on X axis
% values Parameters of the curve; column vector as generated in fit.m
% color,line_style To be used for plotting; no markers shall be used
% pivot
%
% RESULT
% h Handle of dra... |
dae1761fce6632217ae5b58503c1e7fd475f16e1047912aacb3290640d30339e | MATLAB | 3,095 | 103 | function [Sall,thresholds]=allPartitions(Sc,Tree)
% allPartitions Find all cuts of a consensus tree
%
% Syntax
%__________________________________________________________________________
%
% [Sall,thresholds]=allPartitions(Sc,Tree)
%
% Description
%_____________________________________________________________________... |
1a7111eb8e30a9d76e9505659fe9b083ea80c8b60922efdef41cf41b5f4c250b | MATLAB | 3,096 | 86 | function K = relax2tip(P, tips, kappa, Fline, gamma, B, ConCrit, cd, mu, l0, nu, xi)
%iteratively relaxes the contour given the 2 worm tips
%parameters:
%P: initial centerline
%tips: 2x2 matrix with the 1st row being the xy of the head and the 2nd row is the tail
%kappa: image force constant
%Fl... |
2ed9225e2650b3ce97986968f09d858748255ae99e9344caffe8b28524dd7f45 | MATLAB | 3,097 | 76 | function mltp_plot_placemap_information_dists(obj, session)
tFileFilenamePrefixes = session.getTFilesFilenamePrefixes();
numCells = length(tFileFilenamePrefixes);
for iCell = 1:numCells
fnPrefix = tFileFilenamePrefixes{iCell};
% We need to know which trials belong to each conte... |
adb7a05a0e82b3cf2cff46258501c125648cbb99dfe7894342131fe86336968f | MATLAB | 3,098 | 89 | function LFP_Info= PLX2LFPInfo_Correct(PLX_filename)
%% Get LFP_Info from PLX file
%% Input full path of PLX file
%% Output:
%% LFP_Info.LFP = All_LFP;
%% LFP_Info.ch_name = All_LFP_Names;
%% LFP_Info.fs = All_LFP_freq;
%% Copyright WB 2023/02/07
[n, freqs] = plx_adchan_freqs(PLX_filename)... |
2d5c42e09786a85b5b19d8127242c91d6c114582bcbe389b081c7c06cd0c0752 | MATLAB | 3,099 | 91 | function L2(numOfReturnedImages, queryImageFeatureVector, dataset, metric, folder_name, img_ext)
% input:
% numOfReturnedImages : num of images returned by query
% queryImageFeatureVector: query image in the form of a feature vector
% dataset: the whole dataset of images transformed in a matrix of
% features
%
... |
7a20f45f4abd37112d574f458c7a290016c6aa849ccb7f3ecd1cc364b7497195 | MATLAB | 3,101 | 76 | function params = simseq_simulatePRFParams(hemi, spatialModel, veThresh)
% Function to simulate artificual pRF params within ROI
if ~exist('veThresh', 'var') || isempty(veThresh)
veThresh = 0;
end
if strcmp(hemi,'both'), hemis = {'lh','rh'}; else, hemis = {hemi}; end
sigmas = [0.5, 2];
x0 = [4.23, 5.8];
y0 ... |
acb956b448c4cdd99239298b9eb1ebff54558a449222d0ed798160c3c72e5f88 | MATLAB | 3,105 | 79 | % This script creates the mesh (both CAD surface mesh and a computational
% wire grid) for a MagVenture Cool40_Rat 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 edges or curre... |
b0fe249f92fd49dfbf3af023c25bb17034205050c35c846329af257cf8547b5b | MATLAB | 3,106 | 96 | % Calculates a smoothed version of the median absolute deviation (MAD).
%
% -- Function File: MAD = smoothmad (X)
% -- Function File: MAD = smoothmad (X, GROUP)
% -- Function File: MAD = smoothmad (X, GROUP, CONSTANT)
%
% 'MAD = smoothmad (X)' calculates a smoothed version of the median
% absolute deviation (MA... |
40e00a424471390a1fd48137703e431495aa5e19d0ecacf153f0afd77d1c2396 | MATLAB | 3,107 | 95 | classdef Image < types.core.NWBData & types.untyped.DatasetClass
% IMAGE An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)).
% OPTIONAL PROPERTIES
properties
description; % (char) Descriptio... |
fac0ef82d892b7062167df102d43dd4c505ac46ef3e60124dc47b4d8a6f4e034 | MATLAB | 3,107 | 127 | function [Y,snrV,Chf]=modacor22(X,Cy,p);
% It imposes the desired autocorrelation in the given (central) samples (Cy) to
% an image X, convolving it with an even filter of size(Cy), in such a way
% that the image containts change as less as possible, in a LSE sense.
% [Y,snr,Chf]=modacor22(X,Cy,p);
% Chf: Fourier tran... |
a2fcc9c7f49ae8128c71e7dfd47456a82a302df4bc43228a5165077165d134ba | MATLAB | 3,108 | 53 | function test_core_tracker()
script_folder_name = fileparts(mfilename('fullpath')) ;
flytracker_folder_path = fileparts(script_folder_name) ;
flytracker_parent_folder_path = fileparts(flytracker_folder_path) ;
flytracker_test_files_folder_path = fullfile(flytracker_parent_folder_path, 'flytracker-test-... |
d26c42055af95e1703d372d5b186d60d33cb2a515ecdd91f43048c4875568f01 | MATLAB | 3,109 | 80 | % preprocessLegTrack.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
%
% NOTE: if I decide to add filtering on leg position here, ala Anipose,
% this is where it should be added
%
% INPUTS:
% trkFi... |
f66666e2d86ba33af38f003d0ab6325e13a98094c8bdc2bd19c9c916161baa92 | MATLAB | 3,109 | 86 | classdef Configuration < handle
%CONFIGURATION Pipe properties, filters and the like
methods (Static)
function obj = fromData(data, axis)
import types.untyped.datapipe.Configuration;
errorId =...
'NWB:Untyped:DataPipe:Configuration:CannotConfigur... |
0bdacf0ffeb9ed6b6dfd80181866eb2d09cedec3a4d2b62f60a8a8af1be691e8 | MATLAB | 3,110 | 119 | %figS7_highFR_FA_examples.m
%%
clear all;
close all;
clc;
warning('on','all')
%%
scriptdirs = {pwd;
'..\..\plot';
'..\..\helper_functions';
'..\..\analyze'};
addpath(scriptdirs{:})
%%
datadir = pwd;
LFfile = 'len122880f_osc7iter1.mat';
LFpath = fullfile(datadir,LFfile);
HFfile = 'len122880f_osc32iter1.mat';
HFpa... |
efd7d0c288b796209331b1f802121fe5e51177a23643cc0629f7b30cc1def93a | MATLAB | 3,110 | 87 | function [dat,beta,x] = ft_preproc_polyremoval(dat, order, begsample, endsample, flag)
% FT_PREPROC_POLYREMOVAL removed an Nth order polynomal from the data
%
% Use as
% dat = ft_preproc_polyremoval(dat, order, begsample, endsample, flag)
% where
% dat data matrix (Nchans X Ntime)
% order the order o... |
f245646635d2d09b701fb904fcfb31e0c67902c77f92768575b4767b13c74f25 | MATLAB | 3,113 | 132 | %% Try ROIless id of synaptic activations
%% Load green channel
imagelist=dir('*tif');
Info=imfinfo(imagelist(1).name);
for iFrame=1:length(Info);
img(:,:,iFrame)=imread(imagelist(1).name,iFrame);
end
%% Load DF
imagelist=dir('*mat');
for iFrame=1%:length(Info);
load(imagelist(iFrame).name)... |
2bf6155f838d0ae82892f49b5edad4ed68e7efc3405df30fda9ea01971e644c3 | MATLAB | 3,114 | 125 | function [] = ExtDataFig01_BoutLength()
% Code for plotting histograms of pulse and sine song bouts in Extended Data Fig. 1o.
Cond = 'intact'; % Extended Data Fig. 1o
switch Cond
case 'intact'
Target = [3,5,7,9];
end
%% get filenames
selpathOrg = ['../Data/Summary/'];
DataNames_Mic = dir([selpathOrg,'/Mi... |
e4250ebc5968557f7d28f12321c581a7c42cefc2b8e5b6efa04353d412fd24fc | MATLAB | 3,114 | 81 | function mltp_make_trial_position_plots_fixed(obj, session)
if obj.isVerbose()
fprintf('Making position plots using the fixed data\n');
end
% Make the folder if it does not exist
folder = fullfile(session.getAnalysisDirectory(), obj.Config.trial_fnvt_position_plots_folder);
... |
0558fd7f2002ab1f2eb7a081284c8bf4b5126431b139adeb7c736b296d10c7cc | MATLAB | 3,115 | 84 | function [fraction_above,p,Hdist_vel,Hdist]=Hausdorff_distance(score_vel,idx_dir,idx_vel,Ndim,colourArea,nplot)
%% Hausdorff_distance calculates the Hausdorff distance between trajectories
%% in score_vel. This function assumes the data was binned into 2 speeds/distances.
%
% INPUTS
%
% score_vel: Projection of the ne... |
e44349c60cc79b1c2ab90047dec64ac5d34ec994e317f877e08a1b13b2124349 | MATLAB | 3,118 | 97 | function R=latmio_dir_connected(R, ITER)
%LATMIO_DIR_CONNECTED Lattice with preserved in/out degree distribution
%
% L = latmio_dir_connected(A,ITER);
%
% This function "latticizes" a directed network, while preserving the in-
% and out-degree distributions. In weighted networks, the function
% preserves th... |
77ca318bc0efc84e7e13c673c2ecf2be5a663c2aa6171b11e610a5cf192f65b9 | MATLAB | 3,122 | 129 | %% LOAD DATA
mouse='FU1-00';
date='2022-03-17';
load(['/Volumes/Runyan2/Christian/Processed Data/functional-dual_red/FU1-00_2022-03-17_activity.mat'])
load(['/Volumes/Runyan2/Christian/Processed Data/functional-dual_red/FU1-00_2022-03-17_clustering.mat'])
load('/Volumes/Runyan2/Christian/Processed Data/functional-dual... |
8737777e2b2b139ddc534c51dc2907497c4d99111aa2664b27f14d2e0feb8927 | MATLAB | 3,122 | 56 |
%ffmpeg -i CameraFrames\Frame_%06d.tif -threads 8 -an -vcodec ffv1 -coder 1 -context 1 -g 1 -level 3 -slices 24 -slicecrc 1 -pass 1 -passlogfile my_passlog CameraFrames.mkv
%ffmpeg -i CameraFrames\Frame_%06d.tif -threads 8 -an -vcodec ffv1 -coder 1 -context 1 -g 1 -level 3 -slices 24 -slicecrc 1 -pass 2 -passl... |
8b91f067ed2787b16956c91499d42ddf3842875bf4fe0583229baec73dc8c808 | MATLAB | 3,122 | 67 | function fH = plotMeanCSTSustainedTransientBetaWeights(mean_resampledBetavalSust, ...
mean_resampledBetavalTrans,roisToPlot,saveFigs,saveFigDir)
% Set colors
roiColors = getROISummaryColors(0);
white = [1 1 1];
% Compute grand mean + SEM across subjects
for idx = 1:length(roisToPlot)
grandMn_S(idx) = squeeze(... |
0d871b6567bf22de253320819ce82a2c719eea195b2678e7174e8c144543fcd4 | MATLAB | 3,123 | 130 | %% open/read file and set up Environment
%clear;clc;close all
activateCEDS64
% Start Time
START_TIME = 0;
%AstSamples = floor(START_TIME * 1000);
AstSamples = 1;
% Wavelength
WAVELENGTH = 999;
% path to file
file = 'C:\Users\Ruth Empson\Documents\Spike8\data\191217\191217_VOR\segment_1.smr';
fhand1 = CEDS64Open(file);... |
0c50abce107c0170f4e4d9db504b8d53973eda62e42cd9ac067c4cbbb1c435d3 | MATLAB | 3,124 | 109 | % displayFictracVelocityDistribution_ftOutput.m
%
% Function that prompts user for the .dat output file returned by the
% FicTrac program and processes that FicTrac data to display a heatmap
% representing the distribution of counts across yaw and forward
% velocities.
% Displays 3D scatterplot showing point cloud ... |
a8a92610a849d11208563ea33f5da389eb67926acc582e96614d38b0ccedfef2 | MATLAB | 3,126 | 82 | function mltp_plot_behaviour_averaged_placemaps(obj, session)
tfiles_filename_prefixes = session.getTFilesFilenamePrefixes();
digTypes = ['C', 'G', 'F', 'W']; % don't match '?'
numDigTypes = length(digTypes);
numCells = session.getNumTFiles();
firstDigs = {};
trialIds = zeros(1, session.getNu... |
ad33d3bf9520478640231cdcc5d60c10fc37f8dfad13ea5e7c055ca06f455731 | MATLAB | 3,129 | 78 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
fd011733580c8f4ec6f1f92a97b77bcbc32261320f9d9ebcd20b8567a1f68f2b | MATLAB | 3,130 | 102 | function [ax] = plotSpikeModelSample(data,msecs,category,varargin)
%plotPosterSpikeSample.m 2/21/23
% 6/19/23 updating to allow more formatting flexibility
% 7/2/23 updating to says "oscillation" in full
% 7/29/24 updating axes and titles to be consistent
% with RP term notation in main text
if ~isem... |
6faadb33ba264b2b4b2240caba021304efce4ba13a58a700f5ae346083638df4 | MATLAB | 3,131 | 133 | %
% Draw the cumulated degree distributions.
%
% The name "bidd" is historical and refers to "binormalized degree
% distribution". Normalization is just one aspect of it now.
%
% PARAMETERS
% $network Internal name of the network
%
% INPUT FILES
% dat/data.$network.mat
% dat/statistic.(format weights).$network
%
%... |
889c69ef85c7715dc9831859b2ffdda6b0870ca4771a659e8d87ed909b62826f | MATLAB | 3,131 | 93 | %Run simulated normal data to check Type I error rate and power
%
%AUTHOR: Eric Fields
%VERSION DATE: 24 July 2017
clearvars;
%% Set-up
global VERBLEVEL
VERBLEVEL = 0;
%Design
n_electrodes = 1;
n_time_pts = 1;
wg_design = [3 3];
cond_subs = [8 8];
n_subs = sum(cond_subs);
%Effect
dims = [3, 4, ... |
efda8cf13ee2f9f28234b76883b486fbfac185ebef47a7facadf7ace19adff53 | MATLAB | 3,131 | 78 | % preprocessEphysData.m
%
% Function to take output from preprocessUserDaq.m and extract
% appropriately scaled and named ephys data (voltage, current, scaled
% current/voltage, voltage command or current injection command, gain,
% mode, freq)
%
%
% INPUTS:
% daqData - data collected on DAQ, with fields labeled
%... |
7458620e75c68014fb047c61c0dd295097a10eff6b758e813b6b5b7d18233356 | MATLAB | 3,132 | 111 | function VOR_Summary(measure, excel_file, norm )
%{
Required
measure: Data to make into summary graph. Found in the excel file
optional
excel_file: location of the excel file. Default is current folder.
norm: '1' normalize data. '0' use raw values. Default is raw values.
%}
%% Prep Variables
if ~exist('exc... |
196f24893fd550ae6661c03c2618cb588a6b1cef5dc390a4f2295ea1f0b7b4a1 | MATLAB | 3,134 | 106 | function rel_path = relativepath( tgt_path, act_path )
%RELATIVEPATH returns the relative path from an actual path to the target path.
% Both arguments must be strings with absolute paths.
% The actual path is optional, if omitted the current dir is used instead.
% In case the volume drive letters don't mat... |
f3fcd6f11422e4467cc6dc8d3e19107e6404daea6ad3d617bf88c89c00793d7c | MATLAB | 3,135 | 115 | %% Sriram Summary OKR BETWEEN ANIMALS
%% Load File
clear;clc;
try
load('diffData.mat')
T = readtable('diffData.xlsx');
catch
warning('No diffData File Found!')
return
end
color = T.color;
conditions = unique(T.condition);
%% For Each Condition
for i = 1:length(conditions)
A = figure(i);clf... |
41601e4dfb452e39a23e452fb5774bf5d46e905e633ab9cfb842e1d515a63498 | MATLAB | 3,136 | 92 | classdef ZipFolderTest < matlab.unittest.TestCase
% Tests for webupload.zipFolder and selectUploadable. Each test builds
% its own tiny folder.
properties
Dir
end
methods (TestClassSetup)
function addPackageToPath(tc)
tc.applyFixture(matlab.unittest.fixtures.PathFixture... |
2d29b7d62c49e38a8f0b7c7a653c6580582e3ae283a47567aa7ed45828343c74 | MATLAB | 3,137 | 101 | % this script create 2-d slices for 3d scatter
% 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z)
clear;
clc;
close all;
rootFolder = "figure_40_diff/";
% ON-ON
data = readFilename(rootFolder+"asAllCriteria/*_*_*_*.png",'%f_%f_%f_%f');
data( all(~data,2), : ) = [];
diff = 2;
idx = data(:,4) < diff & data(:,4) > ... |
5d0f84529c56708f2e668528582f93a3025e685ecdd08aa5958c4ceaa237bdaa | MATLAB | 3,137 | 90 | % getCorrelationEphysContParam_cond_all.m
%
% Wrapper function for getCorrelationEphysContParam_cond_fly() that takes
% in pData files from multiple flies (either through GUI or input), parses
% them into separate flies, generates output file name, and feeds them
% into the single cell function (called single fly, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.