sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
379added77122d3cefe03c16b58fe02f4ac596425632538e344304211e539f16 | MATLAB | 6,501 | 149 | function fH = plotMeanCSTSustainedTransientBetaWeights_stRetParams(allDS, ...
roisToPlot, saveFigs, saveFigDir)
% Define params
roisNoIPS = [1:6,8,9];
roisToLabel = roisToPlot(roisNoIPS);
nrSubjects = length(unique(allDS{1}.ds.Subject));
cst_s = NaN(nrSubjects,length(roisNoIPS));
cst_t = cst_s;
cst_s... |
c599cf0682a622bec3d42adb71d2f5bf553a9a5a77a3cca04cec96ac29a4d6d5 | MATLAB | 6,501 | 128 | %% ROI analysis
clear;clc;clf;close all
%% Load clean MEG file
% data_folder='/rds/projects/j/jenseno-avtemporal-attention/Load/MEG Data/proc_data/'; %Portal
% addpath /rds/projects/j/jenseno-avtemporal-attention/MATLAB/fieldtrip-20210328 %Portal
% saveFolder = '/rds/projects/j/jenseno-avtemporal-attention/MATLAB/Perc... |
e7618760c344d604ffa42e054a1f0bfda70c0be1cab4e23c72f08e3731cb5e2a | MATLAB | 6,503 | 230 | %% 230324, make figure on the effect of CK on amplitude, IPI (figure used in Fig 7 7S)
%% threshold use 1.05 (if use 1.15, after drug very few data points)
%
%% effect of Arp
excelname='CBD_Arp3_CK666 20240325';
experiment='C_arp_ck_arp'; %use a shorter name to save all the plots
channel1 = readmatrix(excelname,'She... |
283d0934562ee9deb4e685493eb3de48f65efc3381e695214356fe0160c6e438 | MATLAB | 6,504 | 164 | function spm_defaults
% Sets the defaults which are used by SPM
%
% FORMAT spm_defaults
%_______________________________________________________________________
%
% This file is intended to be customised for the site.
% Individual users can make copies which can be stored in their own
% matlab subdirectories. If ~/matl... |
099beefa3a8fdc66abb4de9be7adafcbec0454ec48bd70d51b6c4ec16717dc22 | MATLAB | 6,507 | 156 | function []=saveNII(saveVar, fileName, Params, permuteflag, ext, prec)
% Wrapper function for NIFTI save operation
% updated for v2.5, X.L., 2014-09-08
% updated for v2.8, X.L., 2016-12-08
% updated to include .img/.hdr format, X.L., 2017-05-31
% 2019-02-18, to include dynamics data
% 2019... |
648662caee476ecf77eae67c7b03e614439e2a87f1e959cf98b3f403a8d8bb67 | MATLAB | 6,509 | 227 | function out=import_wcp(fn, varargin)
%IMPORT_WCP Import WinWCP files.
% OUT=IMPORT_WCP(FN) imports data recorded with WinWCP, where FN is a
% string containing the filename. OUT is the output struct containing the
% following fields:
% S Cell with C elements, where C is the number of channels.
... |
08f7900a39201a88ea3d12a58dc8be132d6474da5d9ae7dc631d596c714b9692 | MATLAB | 6,523 | 172 | function append_pdfs(varargin)
%APPEND_PDFS Appends/concatenates multiple PDF files
%
% Usage example:
% append_pdfs(outputFilename, inputFilename1, inputFilename2, ...)
% append_pdfs(outputFilename, inputFilenames_list{:})
% append_pdfs(outputFilename, inputFilenames_cell_or_string_array)
% append_pdfs output.... |
f9e45fc8d62c319e17334550615d7adb9dc5a49841bb163189aa30b091232d56 | MATLAB | 6,531 | 172 | % Fitting a linear mixed effects model.
% reference:
% https://www.mathworks.com/help/stats/linear-mixed-effects-model-workflow.html
%
% INPUTS:
% data_dir (str): path to source data
% read_from_excel (bool): row number within spiketable of unit to plot
% do_plots (bool): produce some plots
%
% Examp... |
abcc33908019029833c5a05a94368479e6d8cd975754ac28bb5cb9fb55e95384 | MATLAB | 6,533 | 144 | function [movingReg,Rreg,tform] = imregister2(varargin)
%IMREGISTER Register two 2-D or 3-D images using intensity metric optimization.
%
% MOVING_REG = IMREGISTER(MOVING, FIXED, TRANSFORMTYPE, OPTIMIZER,
% METRIC) transforms the moving image MOVING so that it is spatially
% registered with the FIXED image. TRANS... |
76ab94eec7e51d7dc70aa35c4865566789f936326cbb15e3b1fe81b0544a52cf | MATLAB | 6,541 | 234 | function varargout=peekSection(section,channel,resize,verbose)
% Crudely assemble a section from raw tiles and show on screen
%
% function [section,imStack,coords] = peekSection(section,channel,resize)
%
% Purpose
% Crudely assemble a section from raw tiles and show on screen. This is a quick and
% dirty way of viewing... |
554e257f98d201296ae2fe0ae6fc177a9b49d1b8931fb7b34388d27d259b132b | MATLAB | 6,543 | 177 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This code computes the population vector cumulative distributions per
% decile (Figure S12A).
close all
clear all
clc
% Paths
run('../load_figure_config.m')
INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER;
OUTPUT_FOLDER =... |
3da08b852ed7510aa5288bae33ee4a615b3fc32189a979a682ccb98b74cf2c62 | MATLAB | 6,545 | 135 | function pths = getSubjectPaths(projectDir, subjID)
% Function to get subject path to reproduce data/figures of paper:
%
% Title: Rethinking simultaneous suppression in visual cortex via
% compressive spatiotemporal population receptive fields.
% Authors: Kupers, Kim, Grill-Spector (2024).
% Journal: Nature... |
2ea24531dc7a03dbbbd8e5b420a3936763e5b4c745bf85c4e73ab01f7f87c6de | MATLAB | 6,547 | 211 | %% Examples of LinePlotReducer
%
% These cells show several different ways to use a LinePlotReducer to plot
% large amount of data gracefully. In some cases, LinePlotExplorer objects
% are created as well to allow the user to quickly examine a plot. It's
% recommended that this script *not* be executed in its entire, b... |
3f20b1b160df4ba92831ee7c641dde8ab9fd9d504b4b05c0d0c5d5efdcc81e06 | MATLAB | 6,550 | 198 | function varargout = generateTileIndex(sectionDir,~,verbose)
% Index all raw data tiles in an experiment, link original file names to position in tile array
%
%
% A tile is defined as a single 2-D image. Each tile is located in a unique position in the
% 3-D sample. StitchIt uses an index file to associate each tile c... |
7b26f831eb787f0ab2570a54f3de1475bfa4e352f5d9b89acb47c2ee3f82ff0a | MATLAB | 6,552 | 139 | function [btime, burst, binary_events] = detect_burst_timeseries(Fs, times, signal, low, high, thrA_factor)
%% Function: 'detect_burst_timeseries'
% DESCRIPTION
% Detects bursts in the time domain by imposing an amplitude and a duration
% threshold on a bandpass-filtered signal
% USAGE
% Full I... |
179a2406fc000a926a8ebc3a672f8ba3a5f7784ffa4129f9b0b6ac0c1ec9c2a7 | MATLAB | 6,553 | 265 | clear all
close all
%you need to have gramm on your path for the plots to work!
%https://uk.mathworks.com/matlabcentral/fileexchange/54465-gramm-data-visualization-toolbox
%also note this script uses only 10 young and 10 older subjects, as the
%data would be too big otherwise to share. The final paper used far more
%s... |
fc4c84d482568ad4c7153c101f51f347ee9c062446bf6d131ca6c0784aa168ad | MATLAB | 6,558 | 151 | function get_partialcorr(combined_info) ... |
56ec57c23d6022566412b3adce7e08010499e3e50c7e8f6e9d82d19f8e8b86d7 | MATLAB | 6,564 | 199 | function header = ReadParFile(filenamePar, Params)
%%
% Author: Xu Li
% Extended by Jiri van Bergen
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
% updated for v3.1 due to .par header change, by X.L. 202001
%% extract Angulation Parameters from Philips par file
% for Philips system ver 4.... |
3347866dcecb2994a4b82a2cd37c6afdc00668b1e1be011fcba1925502c0a768 | MATLAB | 6,568 | 207 | % mglCameraPostProcess.m
%
% usage: mglCameraPostProcess(stimfilename)
% by: justin gardner
% date: 10/29/19
% purpose: Post-processing of camera files to task. This will load images up,
% align the images to task times and then save out as an MPEG-4 file
%
% Default locati... |
5f6330a8312d7995970c19cd7c32b4153196e18582800f43acf968f42dcfdb3b | MATLAB | 6,570 | 196 | function [csInfo, csInfo_good, z] = mainCFanalysis(segData, segInfo, p, expmtFreq, learningType, condition)
%% Get Useful values
z.sr_b = segData(7).samplerate;
z.segTime_b = dattime(segData(7));
z.sr_e = segData(10).samplerate;
z.segTime_e = dattime(segData(10));
z.segLen_s = max(z.segTime_e);
switch segInfo.sineS... |
12cfc703b50754f996a752d7ba8e33a1a070b87c955bd95ad851e28cd66e726b | MATLAB | 6,571 | 205 | function addRawData(DynamicTable, column, data)
%ADDRAWDATA Internal method for adding data to DynamicTable given column
% name and data. Indices are determined based on data format and available
% indices.
validateattributes(column, {'char'}, {'scalartext'});
if (isprop(DynamicTable, column) && isempty(DynamicTable.(... |
f17090763819ba1b2235b11396ce8f67b9b511e0b053bd96e45ee23951a60948 | MATLAB | 6,572 | 172 | function [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial, chanindx)
% READ_SBIN_DATA reads the data from an EGI segmented simple binary format file
%
% Use as
% [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial, chanindx)
% with
% filename name of the input file
% hdr ... |
301f66ef7582d7d42cfcd18102cd56ae2ddaabb62b9514f1b5e6773b75c3051b | MATLAB | 6,579 | 241 |
% Author: Guosheng Lin (guosheng.lin@gmail.com)
% This file shows how to perform training on your own dataset.
% 1. Training demo on PASCAL VOC 2012 dataset
% We here demonstrate the training on the original PASCAL VOC 2012 dataset for semantic segmentation.
% Before running this demo file for training, you need to... |
d1de18b1819646fbf1210abce5d94b27e4879da3a5171055a24e9fdf1bd158a8 | MATLAB | 6,579 | 127 | function params = getTemporalParams(params)
% Function that grabs default temporal params for specified temporal pRF
% model and puts it in params.analysis.temporalModel.
%
% params = getTemporalParams(params)
%
% The function first checks if there is a Constant file (user-defined
% temporal parameter values). if the... |
8abd3d86316d55d95f9c0fe1f342144143c0fe5800dadf4ae6cb55604d1e443c | MATLAB | 6,590 | 159 | function output = correlation_analysis(irep)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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. ... |
34763783a435a660ef8f6bd1210f9b8d4040ebfe0cd0d00878a9bcba550013c3 | MATLAB | 6,595 | 178 | %%%%%%%% edit these values %%%%%%%%
frequencies = [ 10 ...
20 ...
40 ...
80 ...
100 ...
160 ...
200 ];
delays = [ 150 ...
250 ...
500 ...
1000];
intert... |
97a96e4890ee1077627a61cffdf06c44e6ba57c216029306971611de3174e870 | MATLAB | 6,595 | 155 | function [out1, out2, out3] = RunLength_M(in1, in2)
% RUNLENGTH_M - RLE coding as M-function for education
% Run-length encoding splits a vector into one vector, which contains the
% elements without neighboring repetitions, and a seconds vector, which
% contains the number of repetitions.
% This can reduce the memory ... |
01d21b9a1a0d281ab55cf8544f0a60121c080d9b0e030a9fa8dbcc7c7e3ad896 | MATLAB | 6,596 | 137 | classdef MLMiniscopePipeline < MLPipeline
%MLMiniscopePipeline Miniscope pipeline
% A pipeline for the analysis of data from the UCLA Miniscope
properties
CnmfeOptions
SpatialFootprintTrainedModel
end % properties
methods
function obj = MLMiniscopePipeline(config,... |
b0f62f03e7020c2e4a2de1661bf9aeed7084595a1786b9bf92197c0fab1328cc | MATLAB | 6,602 | 110 | function params = getExampleParams()
% Function to create example parameters to run spatiotemporal model
%
% INPUT:
% None
%
% OUTPUT:
% params : (struct) struct with default, example pRF model parameters
% saveDataFlag: boolean (default = true), store data or not
% useGPU: boolea... |
0c0b742222cb52450c6ca51c804f9fdb3a2d19005fb8f74eebb8a7cac71b769e | MATLAB | 6,606 | 186 | % Originally used in Buenrostro et al. NBT 2014
% Author: Jason Buenrostro, Greenleaf lab, Stanford University
% Uses lsqcurvefit to fit 2D Gaussians over sub-images
function FullFit = QuantifyImage(I,adjX,adjY,zeroPix,adjVals)
% Background and cluster centers
bgEst = mode(I(:));
% Define subtile size
stepSize = 24; ... |
5eb0609fd7e07831ca43dab6eafe2a5c9940c91d77bfadc05b116d3901a7e8d1 | MATLAB | 6,606 | 209 | function decoding_movement_direction_all_sessions_v2(Sessions,Areas,threshold,Ndir,k_fold,Nrep)
%% decoding_movement_direction_all_sessions predicts the movement direction bin and angle from the preparatory neural activity
%
% INPUTS
%
% Sessions: cell array containing the names of the sessions to be analysed.
% e.g {'... |
403013c51c5aa63c48698da15cdb45013c244f11c1bcf3bd116d2fdc4ed0e9d8 | MATLAB | 6,608 | 198 | %% generate the nii data of connectivity for two-way ranova
%% each nii contain data:3(icc type)
%% do two-way ranova in MRM toolbox
%% the file sort in MRM is: smo_dbm, smo_vbm, no_smo_dbm, no_smo_vbm
%% do the post hoc with paired t test
%% para
load('ICC_connectivity.mat')
data = results;
roi_num = 48;
sub_num = 120... |
4414899beeadf668c71a66af6476d7acb1a33fe04ca13e67f2821d95d9a4734b | MATLAB | 6,610 | 198 | %% generate the nii data of connectivity for two-way ranova
%% each nii contain data:3(icc type)
%% do two-way ranova in MRM toolbox
%% the file sort in MRM is: smo_dbm, smo_vbm, no_smo_dbm, no_smo_vbm
%% do the post hoc with paired t test
%% para
load('ICC_connectivity_HNU.mat')
data = results;
roi_num = 48;
sub_num =... |
323f010bbc3a3ab3cfdc0cc17882cb5b03a2a363d00b3d7a6d89e65ae3a7dd96 | MATLAB | 6,616 | 126 | function [r_s,myosin2,edges_s3,P] = check_myosin2(T_s,r_s,edges_s,edge_type,myosin2,edges_s1,edges_s3,P)
% check if myosin rods can attach to other spectrin triangles
% check the corresponding triangles
aux_T1 = [find(T_s(P.myosin_T2,1) == edges_s(edges_s1,1));
find(T_s(P.myosin_T2,2) == edges_s(edges_s1,1... |
a27378d94dac19b8fbc9acf9b8e2ba51ec5f5b919463ad28dc4341cd098d234b | MATLAB | 6,630 | 168 | % getEnvelopeStepParams.m
%
% Helper function that takes previously extracted AEP and PEP values for
% each step and uses spline interpolation between them to extract the
% envelope of the signal, which is an estimate of the continous AEP/PEP
% value.
% Then, uses these values to extract continous step length measu... |
44e77accd00a7ffb1d49b8f6ac4afc0ea4a496b70fc40481fec62def63c4a9fd | MATLAB | 6,635 | 219 | % NLS-NLD type of Series Static Dynamic Network (Simultaneous MCNN)
% Mass Constrained Neural Network for Dynamic Data
% Applied on isothermal Van de Vusse Reactor system (changing V)
% Mass Constraints applied on Dynamic Data assuming holdup info available
clc
clear
ni = 1; nh = ni; no = 4;
% Loading the ... |
a3705f808cfac210d382282811ce846fabceabf9ea3aec4403a67438e5fb9ad0 | MATLAB | 6,636 | 127 | %RNAscopeAnalysis
%Code to load excel data exported from QuPath and analyze in Matlab for
%automated quantification and summary.
%Written by Michael B. Ryan - October 16th, 2023
%% Load QuPath data into struct
%Set path for folder with all animal data - each animal should be its own
%folder. Inside that folder,... |
25db7a9fe3458f7fc2ba181c821e841b2768106fa0d93b429ce5068d6203fe0f | MATLAB | 6,637 | 200 | clc; clearvars
%%
load("rainbow_cmap.mat")
load("colour.mat")
%%
addpath("2parGABA")
load("HB1.dat")
load("HB2.dat")
load("LP1v1.dat")
load("LP2v1.dat")
load("LP2v2.dat")
load("HOM1.dat")
load("HOM2.dat")
load("HOM3.dat")
load("HOM4.dat")
close all
close all
f1=figure(1);
f1.Units="c... |
7a6feca04cd368ffe949540fd41d53fdac31e8d2687df17318195de95cdbe670 | MATLAB | 6,639 | 224 | % DETECTPUPILCR detects pupil and corneal reflection in the eye image
%
% Input:
% img = input image
% pupilStart = start point for starburst algorithm for pupil
% radiiPupil = guess of pupil radius
% edgeThresh = threshold for detecting pupil
%
% radiiCR = guess of CR radius
% CRthresh = ... |
dc949350df9efada5a9cab568cd5a82c1444e6c981ae6b57d9b654946c2a8a0a | MATLAB | 6,645 | 161 | %% Fig.1 Experiment 1
% Run config.m
% Loop through each animal
for kk = 1:nanimals
% Determine the number of trials for the current animal
ntrial = size(stim_type_allday{kk}, 1);
% Define the trials for block 2 based on the number of available trials
if ntrial < 230
block2_trials = ... |
703470d2ac0305d91f197fff501ed3c5628a86c393086c393bd80cc4668ce164 | MATLAB | 6,647 | 122 | classdef MLTetrodePipeline < MLPipeline
properties
end % properties
methods
function obj = MLTetrodePipeline(config, recordingsParentFolder, analysisParentFolder)
obj@MLPipeline(config, recordingsParentFolder, analysisParentFolder);
obj.initialize();
... |
4394845ee4546be20f2719d7ce7c03b2c0660c2a223ae286933e11bc8d46efab | MATLAB | 6,657 | 196 | function this = read_gifti_file(filename, this)
% Low level reader of GIfTI 1.0 files
% FORMAT this = read_gifti_file(filename, this)
% filename - XML GIfTI filename
% this - structure with fields 'metaData', 'label' and 'data'.
%__________________________________________________________________________
% Cop... |
6d6ab2f90a924a6638c7b85086c20c7012b35942de55871eaf6141b78d51aeb2 | MATLAB | 6,657 | 183 | function [vertices, label, colortable] = Read_Brain_Annotation(filename, varargin)
%
% NAME
%
% function [vertices, label, colortable] = ...
% read_annotation(filename [, verbosity])
%
% ARGUMENTS
% INPUT
% filename string name of annotation file to read... |
50a67cc36b1e2a4e2ac8eaa58f7d7172e5f2f2205a7b72ef5e9d14305335eceb | MATLAB | 6,662 | 179 | function [xc_out] = interevent_xcorr(src_spk,targ_spk,start_events,end_events,boundSpec,nJtr,jtr_int_msec,smooth_info,xcorr_prefs)
% interevent_xcorr.m
% this function was originally generated to support
% capabilities beyond basic autocorrelation:
% cross-correlations, jitter correction, smoothing, etc
filterFRs = op... |
69ed6c42864791cb163ee9981e4a0f243076a256d50c69175295b31331b88545 | MATLAB | 6,662 | 190 | % preExptRoutine.m
%
% Function that measures pipette resistance, seal resistance, cell attached
% spikes, access resistance, and resting Vm as the early part of the
% patching process. Gives option to run or not run each of these.
%
% INPUT:
% settings - struct of ephys setup settings, from ephysSettings()
%
% OU... |
5374ddad155bd7b218a36232bd8d51f35cf6ccc574364ad0e87194e9c3af8823 | MATLAB | 6,667 | 186 |
%# usage: b = fir2(n, f, m [, grid_n [, ramp_n]] [, window])
%#
%# Produce an FIR filter of order n with arbitrary frequency response,
%# returning the n+1 filter coefficients in b.
%#
%# n: order of the filter (1 less than the length of the filter)
%# f: frequency at band edges
%# f is a vector of nondecreasin... |
61e213da0b338b92451eb5f81eba1c21ad1eeaaa0e516d0caba312587d2e921d | MATLAB | 6,672 | 237 | %
% Draw mappings, i.e., embeddings of all nodes of a network into the
% plane using the two eigenvectors of a given decomposition.
%
% PARAMETERS
% $network
% $decomposition
%
% INPUT
% dat/decomposition_map.$decomposition.$network.mat
%
% OUTPUT
% plot/map.$decomposition.[aucv]{,x}.$network.eps
%
size_plot = ... |
a796fb68648998db8400a3c01777bfb98e355f85d5928693b6dc3acd9487ec5d | MATLAB | 6,674 | 182 | function [data, time, meta] = importaxo(filename)
%==============================================================================
% IMPORTAXO
% Import Axograph (.axgx,.axgd) files to Matlab.
%
% [data, time, meta] = importaxgx(filename)
% [data, time, meta] = importaxgx() => opens a dialog box
%
% OUTPUTS
% data ... |
648a5440539b5ae0efce291906a5d9abb7a341f347638d2a3b34d75d8f9f3340 | MATLAB | 6,698 | 144 | function compute_placemaps(obj, session, trial)
trialResultsFolder = trial.getAnalysisDirectory();
outputFolder = fullfile(trial.getAnalysisDirectory(), obj.Config.placemaps.outputFolder);
if ~exist(outputFolder, 'dir')
mkdir(outputFolder);
end
% Remove any pre-existing placemaps
... |
018341606a5bdc890c0f83b22b2cde2e89dc3c38af215bcbae7eb8dc1ce92f68 | MATLAB | 6,705 | 209 | function [dat] = read_neuralynx_bin(filename, begsample, endsample);
% READ_NEURALYNX_BIN
%
% Use as
% hdr = read_neuralynx_bin(filename)
% or
% dat = read_neuralynx_bin(filename, begsample, endsample)
%
% This is not a formal Neuralynx file format, but at the
% F.C. Donders Centre we use it in conjunction with N... |
ffdc7b8b740387c5928c93c375b203a3377185a75f6d0ba27a5226d25c21bf15 | MATLAB | 6,705 | 144 | function compute_trace_placemaps(obj, session, trial)
trialResultsFolder = trial.getAnalysisDirectory();
outputFolder = fullfile(trial.getAnalysisDirectory(), obj.Config.placemaps.outputFolder);
if ~exist(outputFolder, 'dir')
mkdir(outputFolder);
end
% Remove any pre-existing plac... |
0f8ef5f46dc53678b1dd46c53038c4a46111f09eee0edb1d6db4311f5a906aa0 | MATLAB | 6,710 | 250 | function [] = ExtDataFig03_Example_TimeCourseRaw_TN1SG_IsolatedSong()
% Code for plotting the example trace in Extended Data Fig. 3q.
GT = 'TN1SG';
Target_FileID = 6;
Target_ROI = 1;
Target_Trial = 4;
FileID = Target_FileID;
Target_WithinTrialID = 4; % 4-4
TargetMic = 1;
Xrange = [160 169];
Xrange2 = [130 190];
%% p... |
9bb826587b7943f8a5f887a1b7ba1b8509678c789b8a0e6530e56eec80ed3724 | MATLAB | 6,712 | 234 |
function [out] = conv2fft(z1,z2,shape,shape2)
%CONV2FFT FFT-based two dimensional convolution.
% C = CONV2FFT(A, B) performs the 2-D convolution of matrices
% A and B. If [ma,na] = size(A) and [mb,nb] = size(B), then
% size(C) = [ma+mb-1,na+nb-1].
% C = CONV2FFT(H1, H2, A) convolves A first with the vect... |
1d2ea813af47835627e31b00ed52657a0538f46f8130be4aa6ef741786ac6c1f | MATLAB | 6,720 | 121 | function [r_s,myosin,edges_s2,P] = check_myosin(T_s,r_s,edges_s,edge_type,myosin,edges_s1,edges_s2,P)
% check if myosin linkers can attach to other spectrin triangles
% check the corresponding triangles
aux_T = [find(T_s(P.myosin_T,1) == edges_s(edges_s1,2));
find(T_s(P.myosin_T,2) == edges_s(edges_s1,2));... |
2f17c2a286cfb00d470309783308de33b5ae83df67fb37fb6674f2531883de6c | MATLAB | 6,724 | 177 | % preprocessImaging.m
%
% Function for preprocessing just the Scanimage imaging data. Called by
% preprocess(). Reads in ScanImage .tif files. Aligns each time series.
% Saves the aligned series, unaligned series, mean image, and metadata
% output by ScanImage. Handles both one and multichannel data. Alignment
% ... |
26d12ecf41dd6f3db641500e9d261bd9d04cfee4cf619db186c92a4ae76dca2f | MATLAB | 6,725 | 98 | function [integralxc, integralyc, integralzc, integralpc,...
integralxe, integralye, integralze, integralpe,...
EC, PC] = meshneighborints(P, t, normals, Area, Center, RnumberE, ineighborE, numThreads)
% Accurate integration for electric field/electric potential on neighbor facets
% Copyrigh... |
573b76902aea3f7786a503eed05c8eb64135f3ac3b8dc91a37fff995dc1bac41 | MATLAB | 6,728 | 187 | clearvars
close all
clc
%% SECTION 1: IMAGE MASKING
% SECTION 1.1: Raw Image Referencing
stem = input('What is the image filename? e.g. if file saved as Group1Well##, enter Group1Well: ', 's');
loops = input('How many images need masked?');
first = input('What is the numbe... |
b726764bfb0d6220513501f6deee286efb49295e37a865505738230b7b861f09 | MATLAB | 6,729 | 187 | % computePData_trial.m
%
% Function to compute all processed data (currently, for imaging and
% FicTrac data) for a single trial and save it into a pData.mat file in
% the same trial folder.
% Preprocessing, ROI selection, and FicTrac dropped frames selection must
% have been completed
%
% INPUT:
% trialPath - ful... |
34ed1b1b22c9fce9fd1a99e1769d571fc421cdf3c812b89f9e84310be83ff6ba | MATLAB | 6,731 | 125 | % run amapOFshow
% makeFig2b_EMtunings.m (modified from runFigEMtunings.m) 10.6.2023
clear all; runMode = 'batch';
close all;
globals; initglobals;
PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0;
DATA_TYPE = 'EM';
PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ;
%PLOT_TYPE =... |
442354b7418e292c8b150ea98ed78fe9a096bb481a626781c29b1ad3b8b1b427 | MATLAB | 6,735 | 102 | function [cnmfeOptions] = men_cnmfe_options_create(varargin)
p = inputParser;
p.CaseSensitive = false;
addParameter(p,'framesPerSecond', 30, @isscalar);
addParameter(p,'verbose', false, @islogical);
parse(p, varargin{:});
if p.Results.verbose
fprintf('Using the followi... |
b619747130a3e82305b9fec57374ce3c8e3b68529e4e030c9137d8c8dbcb2fad | MATLAB | 6,736 | 181 | function [perCell, total] = temp_compute_bfo_general(obj, session, rotDeg, mirrorContexts)
% mirrorContexts should be the same length as the number of contexts
% an entry of 0 means do not mirror, and 1 means to mirror
% this is used because often context 2 has the reward cup mirrored
% Allow the f... |
92f26f1fc99d8e00990690a003c232081a10baea13a085fe0842a164b834ed2a | MATLAB | 6,741 | 203 | function [rs,ts,CI,pval,outid,h]=skipped_Spearman(varargin)
%SKIPPED_SPEARMAN Spearman correlation after bivariate outlier removal
%
% performs a robust Spearman correlation on data cleaned up for bivariate outliers,
% that is after finding the central point in the distribution using the mid covariance
% determinant, o... |
802b29ecd270fdc6fc6d5651f015e5c524c2e5fce5c9352ed3fb810027dd11d9 | MATLAB | 6,742 | 182 | function [lm, sumChannelPrediction] = ...
fitModelPredictionToDataWrapper(data, predictions, varargin)
% Fit model prediction to data at single voxel level
%
% [lm, sumChannelPrediction] = ...
% fitModelPredictionToDataWrapper(data, predictions, varargin)
%
% INPUTS
% data : (doubl... |
d3a609eb36e3168196bfea1d5e42cf593de40412368487b757719964c159e3d2 | MATLAB | 6,743 | 178 | function [dat] = read_brainvision_eeg(filename, hdr, begsample, endsample, chanindx)
% READ_BRAINVISION_EEG reads raw data from an EEG file
% and returns it as a Nchans x Nsamples matrix
%
% Use as
% dat = read_brainvision_eeg(filename, hdr, begsample, endsample)
% where the header should be first read using read_br... |
1a554ce34aee535959a52b40d1a23fb3023c9ddc96ada1e54b0740905543e051 | MATLAB | 6,751 | 168 | function PMUstructmat = TransformPMUOutput(PMUdir,varargin)
%UNTITLED4 Summary of this function goes here
% Detailed explanation goes here
respfreqmax = 25;
pulsfreqmax = 200;
if isempty(varargin) == 0
for i = 1:size(varargin,2)
if isstruct(varargin{i}) == 0
switch(varargin{i})
... |
9261f238810c84d38b693380dea19b3b38b9cd9fc24a813cee4139fd22466e20 | MATLAB | 6,751 | 175 | function compute_fluorescence_rate_scatterplots(obj, session)
animalName = obj.Experiment.getAnimalName();
sessionName = session.getName();
sessionAnalysisFolder = session.getAnalysisDirectory();
% sessionName = session.getName();
% sessionAnalysisFolder = fullfile('R:\chengs_task_2c\data\minim... |
73f1a8caa6ae28e7ec76292edc3fedc1058bf58e097a34f0de3d06da56f34382 | MATLAB | 6,765 | 139 | % Extract 2D keypoint (marker) trajectories and their confidences from OpenPose output.
function [keypoint_table, confidence_table, subjects_per_frame] = OpenPose_to_keypoint_table(output_path)
subjects_per_frame = [];
cd(output_path)
files = dir('*_keypoints.json');
for i = 1:length(files)... |
ba415070e43391f2e5d23ba0528d5be6cf36a9cf9c835294aaee9aa7b7b8b80e | MATLAB | 6,766 | 171 | function [mask,psfs3,psfs,psf2p2] = genCorticalLightPath_1p(vol_params,psf_params,vol,Uin)
% [mask,psfs3,psfs] = genCorticalLightPath(vol_params,psf_params,vol_out,Uin)
%
% This function generates a point-by-point map of obscuration for TPM
% imaging setting across a neural volume. The function generates a 3D mask
% ... |
7554ab15a2179a75270f735124f04a1272ff2f42aa440d19b6a687810a9d5b06 | MATLAB | 6,779 | 165 | % function [RegressionSummary] = multivariateregression(Y,X)
%Multivariate multiple regression on DVar Y along dimensions d and IVar X along dimensions p.
%Y is the dependent variable, each row subject, each column is condition. Xmat is matrix containing IV, should be all n x p, where n is subject
%and every column p ... |
7d47eed36b12446cd4f53875d90fd4322613fc33c6ea60eca35cbed0b5c64fbe | MATLAB | 6,782 | 208 | %% to restart everything
clear variables
close all;
clc;
cond = 'dd';
% set the ones to true that should be plotted
erp = true;
correlation = false;
multiplot = false;
topoplot = false;
%% Load necessary code
% paths to store the plots in
basepath='.../MatlabCode';
cd(basepath);
savepath = '.../data/processed/EEG';... |
12de76eabf9ed9e083f9e60557a43f5b70bd89e453c0795f26d90805f148cbb2 | MATLAB | 6,783 | 164 | function headmodel = ft_datatype_headmodel(headmodel, varargin)
% FT_DATATYPE_HEADMODEL describes the FieldTrip MATLAB structure for a volume
% conduction model of the head that can be used for forward computations of
% the EEG potentials or the MEG fields. The volume conduction model represents
% the geometrical and ... |
358712ab1979e66b973944214325cc40c5f8ce0971793497fda5860a41947258 | MATLAB | 6,791 | 170 | function [sEPhysAnalysis]= EPhysAnalysis(mouse, date, movie, touches,good_electrodes,endFrame,startRecording,stopRecording)
% mouse='Thalamus17';
% date='20150412';
% movie='5';
% touches=[];
% good_electrodes=[1];
% endFrame=281474;
%% Cheetah Events
sf=1000000;
% (R:\TessData\EPhys Data\Thalamus39\201604... |
dcf13ecd1fd472fda5f6dfdea7c0832f33657fb16590371839084514f0951f8b | MATLAB | 6,793 | 215 | function val = correctType(val, type)
%CORRECTTYPE
% Will error if type is simply incompatible
% Will throw if casting to primitive type "type" is impossible
invalidConversionErrorId = 'NWB:TypeCorrection:InvalidConversion';
invalidConversionErrorMessage = sprintf( ...
'Value of type `%s` cannot be converted t... |
05ed1c00581c6379b0bb49a1aff7e519279affe14df6e7018dd12b56b7ad9aa2 | MATLAB | 6,795 | 181 | % testExperiment.m
%
% $Id$
% usage: testExperiment
% by: justin gardner
% date: 09/07/06
% copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING)
% purpose: example program to show how to use the task structure
%
function myscreen = testExperiment(screenName)
% check arguments
if ~any(... |
c797f5653a4d873860903a25de46f1cf415f7084a74aae078066809c33112060 | MATLAB | 6,797 | 181 | % testExperiment.m
%
% $Id$
% usage: testExperiment
% by: justin gardner
% date: 09/07/06
% copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING)
% purpose: example program to show how to use the task structure
%
function myscreen = testExperiment(screenName)
% check arguments
if ~any(... |
0f844b94bb759647c624b7287bc5838b6b8e385063f38270820b7d766eadd893 | MATLAB | 6,803 | 216 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This reproduces Figure 6B (which was made in Excel).
close all
clear all
clc
% Paths
run('../load_figure_config.m')
INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER;
OUTPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.FIGURE_OU... |
a5870a5c1a65c97dba348f1383feb7b27589c7a2b998e4f74393eb7ae329127e | MATLAB | 6,805 | 196 | % plotBallLegStepParamIndpt_diffAEPPEP_allFlies.m
%
% Function that takes output from saveBallLegStepParamCond_indpt() and
% plots the difference in AEP or PEP for each leg in the XY plane
% between 2 conditions.
% Different conditions are different output files. Matched by name. One
% output file per fly. Has optio... |
d8f9e2fcd7d75d684fac83bb154e735c1b1f03c534dc4eaedbf0525e662ccc93 | MATLAB | 6,812 | 214 | function [ wlimits ] = ternary_axes_limits( varargin )
%ternary_axes_limits support function for obtaining ternary axes limits
%
% Determines the lower and upper bound limits for axes 1-3 in a 2x3
% matrix "wlimits" consistent with the specifications. The first and
% second rows of weight_limits correspond wi... |
2061e9b0e506350be2b2c8a4449c419fc540d04b285c09cc047dd5c50d669d56 | MATLAB | 6,826 | 242 | close all
clear all
clc
tmp = load(fullfile('M:\\Minimice\\CMG094_RSC_LAPTOP_MS\\analysis\\chengs_task\\s4\\H13_M24_S8', 'behaviour_scope_videocoords.mat'));
% mouseImage = imresize(imread('light-grey-mouse-md.png'), [10,10]);
% figure
% imshow(mouseImage)
%
% figure
% heatmap(mouseImage)
%
% mouseImage(mouseImage ... |
45849ed687e42238624200a1b03ef99761d40371378ccc220de6e9c354ef6ecc | MATLAB | 6,832 | 146 | function [] = plot_worm_frame_post_analysis_showing_path_stationary_dots(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio,smoothed_path_x,smoothed_path_y,stimulus_delivered,path_history,demo_mode,dot_path_x,dot_path_y,dot_path,current_head_angle)
% % % % % % [] = ... |
4855f30ee9b2d1687ffd44b02531dd42ac2aa9e8eccd80cb95a6755b84591a0a | MATLAB | 6,832 | 224 | function vl_demo_kdtree_sift
% VL_DEMO_KDTREE_SIFT
% Demonstrates the use of a kd-tree forest to match SIFT
% features. If FLANN is present, this function runs a comparison
% against it.
% AUTORIGHS
rand('state',0) ;
randn('state',0);
do_median = 0 ;
do_mean = 1 ;
% try to setup flann
if ~exist('flann_search'... |
c0cc779c681a4f8e799689dfc5f00f2c4b8a04841de3efa0de517967f4143a39 | MATLAB | 6,839 | 144 | function [U] = l3ddir(srcinfo,targ,pgt)
%
%
% This subroutine computes the N-body Laplace
% interactions and its gradients in three dimensions where
% the interaction kernel is given by $1/r$
%
% u(x) = \sum_{j=1}^{N} c_{j} \frac{1}{\|x-x_{j}\|} -
% v_{j} \cdot \nabla \left( \frac{1}{\|x-x_{j}\|}\right) ... |
ccca0062a19d3668fa9d3f221dc75d2775670e56b84eaa3d1ea6ed3a9767bf5a | MATLAB | 6,846 | 168 | function compute_mcmappy(obj, session, trial)
experimentDescriptionFilename = fullfile(obj.RecordingsParentFolder, 'experiment_description.json');
uniform_dt_ms = 10;
dmax_cm = 0.25;
maxSpeed_cm_s = 30;
cm_per_bin = obj.Config.placemaps.cm_per_bin_rect_both_dim;
cm_per_bin_x = cm_per_bin;
cm... |
9847040eeb30d4e8d9b1abb7a88718cc1279e7af53762c20e4c3a5683a1bdb80 | MATLAB | 6,847 | 204 | function [t_from_new,t_upto_new]=Trajectories_differ_by_dir_all_sessions(Sessions,Areas,threshold,Ndir,Nbins)
%% Trajectories_differ_by_dir_all_sessions calculates the distance between
%% trajectories corresponding to different movement directions
%
% INPUTS
%
% Sessions: cell array containing the names of the sessions... |
34e500d09fa7ceb95fccad81df114339704ebc643029dcc20feb5c736d3c4aab | MATLAB | 6,851 | 145 | function trial = createTrialSet_varyArea(params, ims, scan,trialSetsDir)
% function to create specific trial structure for simseq PRF experiment
% outputs struct called 'trial' with params for each trial, which is
% each screen flip, which is 60 Hz (so 1/60 = 0.016667 s)
trial = struct('cond',num2cell(length(param... |
67d241f5b81e41b7d851ad7f7b1100edb689b4b7fdc484b2f4b84b2455932d76 | MATLAB | 6,856 | 175 | function [run]=load_run_info(run, ID)
%% LOAD_RUN_INFO
% Loads information about the runs for each participant. E.g. if the runs
% are complete or not & what the valid window for this run is.
%
% INPUT:
% - run: matlab structure containing the raw nirs & motion data of each run
% - ID: participant-ID of the run that is... |
e33d32e8a5e0133b97acb90f90bc274b226ba634febea5337e98914084e5e20e | MATLAB | 6,876 | 243 | function im = vl_impattern(varargin)
% VL_IMPATTERN Generate an image from a stock pattern
% IM=VLPATTERN(NAME) returns an instance of the specified
% pattern. These stock patterns are useful for testing algoirthms.
%
% All generated patterns are returned as an image of class
% DOUBLE. Both gray-scale and colou... |
e54f2f44f697036f49cca0cb1e86104ddfcc14941941310899e6a746e5446347 | MATLAB | 6,885 | 186 | % updateMetadataSprdsht.m
%
% Function to update ephys metadata spreadsheet 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 of columns that matches
% what this function writes.
% Ad... |
a1fff63371139314cfd3f0c62d0c0fe7ad7d65907deef9f1a4b23f3d555113d0 | MATLAB | 6,886 | 173 | function comp = ft_datatype_comp(comp, varargin)
% FT_DATATYPE_COMP describes the FieldTrip MATLAB structure for comp data
%
% The comp data structure represents time-series channel-level data that has
% been decomposed or unmixed from the channel level into its components or
% "blind sources", for example using ICA (... |
2a71e12fd8e965a18b755a8827e6604cbf7e2f754645520e403cd9cca3b763e5 | MATLAB | 6,887 | 199 | function [rp,tp,CI,pval,outid,h]=skipped_Pearson(varargin)
%SKIPPED_PEARSON Pearson correlation after bivariate outlier removal
%
% Performs a robust Pearson correlation on data cleaned up for bivariate outliers,
% that is after finding the central point in the distribution using the mid covariance
% determinant, ortho... |
3b61df884c61d9036c9bace8bd3bb29b7963fa7530a66e2bb5635c70128a8992 | MATLAB | 6,890 | 244 |
function [layers, net_output_info, dag_net]=gen_network_featnet_resnet(featnet_config)
pre_trained_model_file=featnet_config.pre_trained_model_file;
fprintf('load init model:%s\n', pre_trained_model_file);
tmp_obj=load(pre_trained_model_file) ;
dag_net = dagnn.DagNN.loadobj(tmp_obj) ;
dag_net.removeLayer('prob');... |
680838eb5d442e3208c0b674ca3e7d6abfc9ef1ffcda552bc3c6515c60d3e3dc | MATLAB | 6,905 | 187 | function [boxes, hierarchy, blobStruct, mergeThresholds] = ...
BlobStruct2HierarchicalGrouping(blobStruct, neighbourMat, numInitBlobs, CalculateSimilarity)
% [boxes hierarchy blobStruct mergeThresholds] = BlobStruct2HierarchicalGrouping
% (blobStruct, neighbourMat, numInitBlobs, CalculateSim... |
d241e1d763298387e175ccadc2ed8d062253464be7e95dd0f8361ac6f9881e3f | MATLAB | 6,905 | 237 | function experiments()
% EXPERIMENTS Run image classification experiments
% The experimens download a number of benchmark datasets in the
% 'data/' subfolder. Make sure that there are several GBs of
% space available.
%
% By default, experiments run with a lite option turned on. This
% quickly runs all... |
74885b43df5f449542086bebe7af8e6fa164128699896fc4099e19c0f4565eb3 | MATLAB | 6,907 | 161 | % function gm_counting_consolidation(data_dir, read_from_excel)
%
% INPUTS:
% data_dir (str): Path to source data (default: 'source_data').
% read_from_excel (bool): Flag to read from Excel (true)
% or .mat files (false) (default: false).
%
% here we consider all units responding ... |
abb9a5390625f46820082c7219fc06ce98ab9376b99c77fe315d2d5c9b57c943 | MATLAB | 6,913 | 128 | function [results] = read_fit_results_and_compute_a_mpe_and_a_std(path_of_script,voxel_folder,simulated_SNRs,number_of_noise_realizations,slice,results,AxTM)
perc = 5; %
accuracy_threshold = 0.05; % threshold for ground truth reproduction (= 5% difference to ground truth)
standardDKI_AxTMs = zeros(1, nume... |
ad3ec1bdf4dd5f756957102050489ea122ccb3025cc862746d587d6e5f67504a | MATLAB | 6,914 | 272 | function [vol, M, mr_parms, volsz] = load_mgh(fname,slices,frames,headeronly)
% [vol, M, mr_parms, volsz] = load_mgh(fname,<slices>,<frames>,<headeronly>)
%
% fname - path of the mgh file
%
% slices - list of one-based slice numbers to load. All
% slices are loaded if slices is not specified, or
% if slices is emp... |
293d64f5030a43d937908f20c7fa5f2eb5bec3fd467f8e36ae3741978de5e492 | MATLAB | 6,929 | 212 | close all
clear all
%% create figure 4D
%% janine.thome@zi-mannheim.de
mod = 1; % 1=VOL & FC; 2= VOL & DYN; 3= DYN & FC
%% paths
pato=['/###/Figures/']; %% add output path
if ~isdir(pato), mkdir(pato)... |
f9832e106830e246a5bc904b4cf8978e7484d0faef79ea77d67844ad0d5520b6 | MATLAB | 6,933 | 229 | % mglRetinotopCreateStimulusImage.m
%
% $Id:$
% usage: mglRetinotopCreateStimulusImage()
% by: justin gardner
% date: 10/17/11
% purpose:
%
function maskImage = mglRetinotopyCreateStimulusImage(stimfile)
% check arguments
if ~any(nargin == [1])
help mglRetinotopCreateStimulusImage
re... |
9dfd1549a7cacb21536882ddc93a6d43c5366ec82da1a2c5b69c33ee3d372f6e | MATLAB | 6,939 | 221 | close all
clear all
%% create figure S2
%% janine.thome@zi-mannheim.de
mod = 2; % 1=VOL & FC; 2= VOL & DYN; 3= DYN & FC; REPEAT WITH 3 for Fig S2 B
%% paths
pato=['/###/Figures/']; %% add output path
if ~isdir(pato), mkdir(pato); end
%% load results
if mod == 1
... |
f4eb3161fd0d2a3667e94c9dcf1bb738b5df3fee0dfbbb31a6116c01700499c1 | MATLAB | 6,947 | 197 | function buildSectionRunner(chan,runInPath)
% Simple function that constantly looks for new data and sends them to the web if found
%
% function buildSectionRunner(chan, runInPath)
%
% Purpose
% Sends new data to the web when completed directories are found.
% Aborts when the FINISHED file a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.