sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
134257a6a2e4b4af1daef0652c1ac627382ae747e53b52acd6a71eaf84f5ccdb | MATLAB | 1,724 | 51 | % Parameter configuration for TS extraction for resting state fmri
% Parameter configuration for TS extraction for resting state fmri
% _________________________________________________________________________
% Stanford Cognitive and Systems Neuroscience Laboratory
%
% $Id rest_ts_extraction_config.m $
% -------------... |
2d79aa60b88c9991414879d2e587f021b256e2c7a16a5bfb261f1edc296bad57 | MATLAB | 1,724 | 51 | % Parameter configuration for TS extraction for resting state fmri
% Parameter configuration for TS extraction for resting state fmri
% _________________________________________________________________________
% Stanford Cognitive and Systems Neuroscience Laboratory
%
% $Id rest_ts_extraction_config.m $
% -------------... |
3b81f7ac58fc144aadcae4c4ffebb975195572ebb4859d3e93aa7b237f773545 | MATLAB | 1,724 | 62 | function val_mask_geometry
% Is mask/data geometry matching robust to harmless affine roundoff?
%
% ______________________________________________________________________
%
% Christian Gaser
% ______________________________________________________________________
val_util('header','Mask geometry check');
val_util('ext... |
afca5b6006d10b076178e3ba923a672ad6a4fba56186e24c98c6a6cb14bfab0e | MATLAB | 1,724 | 51 | % Parameter configuration for TS extraction for resting state fmri
% Parameter configuration for TS extraction for resting state fmri
% _________________________________________________________________________
% Stanford Cognitive and Systems Neuroscience Laboratory
%
% $Id rest_ts_extraction_config.m $
% -------------... |
fdf49f36c2e395cfdffe1a499db60e4dd4f6e06bacff10b5a4da00b70de46f64 | MATLAB | 1,724 | 80 | %% Load RBR by group
clear; close all; clc
load('RBRComb_good.mat'); %mean of the consistency as a function of track location
RBRG = cat(2,RBRComb(:));
meanRBRG = cellfun(@(x) mean(x,1,'omitnan'),RBRComb);
semRBRG = cellfun(@(x) nansem(x,1),RBRComb);
load('RBRComb_bad.mat'); %mean of the consistency as a fu... |
afa07b8d5c8aeb3e6a82a1f7cb7dece280acbafbecc2d471882de746a331c80b | MATLAB | 1,725 | 78 | % op_averaging.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_averaging(in);
%
% DESCRIPTION:
% Combine the averages in a scan by adding the averages together and then
% dividing by the number of averages.
%
% INPUTS:
% in = input data in matlab structure format.
%
% OUTPUTS:
% out = Output following... |
98a3ca2c422f12b18af484a8dd09fc1a9696d9ee188d93f615b2edf2d5fd96f1 | MATLAB | 1,728 | 43 | function [ resultant, CI ] = AngularActivity( stretchAngle, stretchMag, subActivity, varargin )
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
if nargin > 3
TestRange = varargin{1};
RangeInd = find( stretchMag > TestRange(1) & stretchMag < TestRange(2) ); % indices o... |
23137e7b2c2cfb644597876b4f20d48d21c2080960faa7f9ff7f7b08b21c6028 | MATLAB | 1,729 | 51 |
clc; clear;
% what is not provided in the code
% 'path': where the functional images are saved
% 'mreg': matrix of nuisance regressors (# rows equals to # scans)
maskpath = '~/Desktop/GlobalConnectedness/masks';
nscans = 430; % number of scans in each run
gm_nii = fullfile(maskpath,'gm_0.1_3mm.nii'); % gr... |
31ed27f351ba9cbafedf1353e0821a3825d310058e15a7b8c88a9a4525b91428 | MATLAB | 1,729 | 50 | clear all;
load('splintr3F2_results.mat');
output_dir = '/Users/goody/Neuro/ExSeq/splintr/3F2Morphology/';
IMG_SIZE = [2048 2048 100];
%% First create a 3D image of all the puncta in space
output_img = zeros(IMG_SIZE);
for p_idx = 1:length(transcript_objects)
output_img(transcript_objects{p_idx}.voxels) = 500;
... |
a1ca28c660e938cf0fc47ff73895bf5e73c793cc7228211976eb7d81d529deb8 | MATLAB | 1,730 | 46 | cd 'C:/Work/MatlabCode/projects/BrainMetabolismModeling/BrainMetabolismModeling'
load('data/MinModel.mat')
%Data for Fig. 4E, S2
simulateCombSimpleModel(minModel, 'data/simpleModelOutputRedMitMob.mat', 0.15, 0.1, 0.1, 0.1, 0.1, 0.5, 0.4, 0.2);
simulateCombSimpleModel(minModel, 'data/simpleModelOutputTransport.mat... |
8dfd6ee9dd498c6522b2cba4106eaefc2072970e0a067c33aec65e02af5c9643 | MATLAB | 1,733 | 43 | function self = post_process_diameter(self, pixelSize)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either vers... |
67915cd4af0d8e55193170552389ded8c7162b92febeb55b04a0411d3734e879 | MATLAB | 1,734 | 58 | function [t, x] = start_alignment(t, x, t_range)
%%% start_alignment.m
%%% Omkar N. Athavale, May 2023
%%% Calculate the peak, plateau, and frequency metrics for a given signal
%%% Can be tension, Vm_ICC, or Vm_SMC
%%% INPUTS
%%% t: n x 1 array of n time steps in ms
%%% x: n x 1 array of quantity at n time steps coresp... |
7bd8ceaaf744fecf4f4120ad0e6349b968474ef831931295635a38f45d31f8f2 | MATLAB | 1,736 | 46 | function CAxis = check_cAxis(CAxis, img)
%check_cAxis - Check that the colour axis is appropriate
%
% CAXIS = check_cAxis(CAXIS, IMG) checks that the supplied values of
% CAXIS, the colour/intensity axis limits, are appropriate for the image
% IMG. CAXIS must be an empty, scalar, or length two numeric vector
% ... |
212ee9aaa7aa650b02edfe4f9d4518f12e89222181383052a5a06704589197c3 | MATLAB | 1,737 | 82 | %%
clear; close all; clc
files = findSubF('behavior_NT.mat',1,[],0);
groups = {[1 4 5 6],[2 3]};
skipDays = {[0 4 4 0],[0 0]};
nG = length(groups);
nDays = 10;
combLick = cell(nG,1);
combSlow = cell(nG,1);
combLickMean = zeros(nG,nDays);
combSlowMean = zeros(nG,nDays);
combLickSEM = zeros(nG,nDays)... |
77aab34e7df9ca925c76900f2192e634a63c61789b719afd6ecb8f78509ed916 | MATLAB | 1,741 | 48 | function ndef = notDefined( varString )
% Test whether a variable (usually a function argument) is defined
%
% ndef = notDefined( varString )
%
% This routine is used to determine if a variable is defined in the calling
% function's workspace. A variable is defined if (a) it exists and (b) it
% is not empty. This r... |
84731e40f13b87d0e17324c7b4f68b890bc7043e78bacfddc1aa4b4b95f1fe4e | MATLAB | 1,741 | 56 | %%% parallel_SA_simulate.m
%%% Reads a matrix of parameter values and simulates the model with
%%% f_i = f_e = 1 for all values. The script SA1_sampling.py uses SALib in
%%% Python to generate Saltelli sample of +/-10% of the selected parameter
%%% values. Run SA2_analysis_plot.py after this script to perform
%%% Var... |
3b78fd2b69aa8927c900d4d776edb437da57273f8b00c80552dc622e8ab0d027 | MATLAB | 1,743 | 45 | %%
% Reproduces Fig. 5D and 5E in:
% IA Oldenburg, WD Hendricks, G Handy, K Shamardani, HA Bounds, B Doiron,
% H Adesnik. The logic of recurrent circuits in the primary visual
% cortex. Nature Neuroscience (2024)
%
% Written and edited by G Handy, IA Oldenburg, and WD Hendricks
%%
clear;
% Load the simulation ... |
5d1c371df711486f52987767ba428f025d7b3b384e85d7776fa35c5d1cf83137 | MATLAB | 1,744 | 60 | function isNewer = isVersionNewer(referenceVersion, testVersion)
% Return true if testVersion is more recent than referenceVersion
%
% isNewer = zapit.updater.isVersionNewer(referenceVersion, testVersion)
%
% Purpose
% Accepts structures of the form produced by versionStringToStructure
% an... |
91599e1f999d95912fe9930e60a0168285851596d2d19c4248d6b8f65b1d6bc8 | MATLAB | 1,744 | 69 | % ELEN_TREE Electrotonic length of segments in a tree
% (trees package)
%
% elen = elen_tree (intree, options)
% ----------------------------------
%
% Returns the electrotonic length of each segment (length/lambda).
%
% Input
% -----
% - intree ::integer: index of tree in trees or structured tree
% - options ... |
ffb744aff7f980306c3a15a41fa04c0377610ce03b79d848be61e8f81ebd6cb1 | MATLAB | 1,745 | 81 | function [versionDetails,allVersions] = getVersionFromChangeLog(pathToChangelog)
% Get Zapit version and release date from the CHANGELOG
%
% function versionDetails = zapit.updater.getVersionFromChangeLog
%
% Purpose
% Get Zapit's version from the CHANGELOG.md file
%
% Inputs
% pathToChangeLog - [optional] by default t... |
055e706a73c1d0a0e2218dfb3550c07415845c8609b709e80033c8fca0b66bb9 | MATLAB | 1,747 | 68 | function y = nanmean(x,dim,ignoreinf)
% FORMAT: Y = NANMEAN(X,DIM,IGNORE_INF)
%
% Average or mean value ignoring NaNs
%
% This function enhances the functionality of NANMEAN as distributed in
% the MATLAB Statistics Toolbox and is meant as a replacement (hence the
% identical name).
%
% NANMEAN(X,DIM)... |
32041cab5ed14968a92638577d08008d1f24aae6fbb86391f75664c92050aa2b | MATLAB | 1,747 | 80 | %% visAccRead.m
% analyze visual accuity discrimination task. Calculates the percent of
% trials correct and d-prime statistics
%% Set paramters
wReward = 4;
wError = 2:3;
d = dir('*T*.txt');
logData = readLog(d(end).name,10);
params = logParamsVis(logData);
trials = struct();
%% Identify re... |
c89f20f231378a9a23eb2c52798571bedddf82c5a654e178cffbcd81492759aa | MATLAB | 1,750 | 46 | function stim = makeTextures(display, stim)
%stim = makeTextures(display, stimulus)
%
% - Note that there is another command, createTextures, that does the
% same basic function. We need to decide which we want and merge -
% Bob thinks at the moment that we should use createTextures, but we're
% not sure.
%
% Repl... |
296f3a70a55a2286f0f7c62eee770aad840bfa69a4dce85bba14cf23db5d7b28 | MATLAB | 1,751 | 52 | function fnFullRaw = uiputfile_helper(varargin)
%uiputfile_helper - Helper function for saving files
%
% This function is not intended to be called directly.
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under ... |
96b070c48ff1dc7b5cc784b89778b93d8e7f7041472a356fe9f20e584f99253c | MATLAB | 1,752 | 42 | function [ShowEdgeFig, sp] = ShowEdges(edges, showIm, varargin) %
if nargin > 2
binaryIm = varargin{1};
Nsp = 3;
else
binaryIm = [];
Nsp = 2;
end
imSize = size(showIm);
opt = {[0.01,0.03], [0.07,0.04], [0.02,0.02]}; % {[vert, horz], [bottom, top], [left, right] }
ShowEdgeFig = figure('Wi... |
1803fc4b38c1115b12a4889795c248ceb61f433f583e8485ae118ec4f1ebb0bc | MATLAB | 1,754 | 61 | %%% dosage_sweep_plot.m
%%% Omkar N. Athavale, May 2023
%%% Plot sweeps across f_i and f_e with fixed parameter
% --- INPUTS ---
n = 21; % number of points to sweep (all variables same)
% --------------
% parameter info
names = {'f_i', 'f_e', 'f_i & f_e'};
effect_vals = [0.329454438664630,0.773384113014197,0.39695091... |
b256e7d3f0c0fbd0f422cfa3636af01c25ec66ff4e1e0fbf001265da47f42b7b | MATLAB | 1,756 | 48 | function hProcessable = create_constructor_processable(varargin)
% create_constructor_processable - Protected helper function to create a
% Processable object constructor
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify... |
b42fefe37451115e84f9669f00240458d37e046d82ac317b715df4327eb16b6a | MATLAB | 1,756 | 50 | function f = createTemporalChannel(params,modelNumber,windowSize)
if isempty(params)
params.tau1 = 0.05; params.weight = 0; params.tau2 = 0.1;
params.n = 2; params.sigma = 0.1; params.scale = 1;
params.tau_s = 5;
end
params.fs = 100;
t = 0:(1/params.fs):windowSize;
if modelNumber ==1
f.temporal(:... |
99deabde6a858411d11d260c4144badaf10a277b15ed78745db09c2d5ce53e4b | MATLAB | 1,757 | 54 | classdef BH32 < handle
%BH32 TDT BH32 class.
% obj = BH32(varargin) controls a BH32 through SynapseAPI
% optional argument is the Synapse computer IP address, otherwise
% defaults to 'localhost'
%
% obj reference to BH32 object
% obj.read ... |
280223eab8a7f214c9cce866c83f17a8e382ed064142f792e5d1a8675d22a1cf | MATLAB | 1,759 | 37 | classdef (Abstract) ConfigHelper < matlab.mixin.Copyable
%Config - Superclass for ConfigHelper classes
%
% ConfigHelper is an abstract superclass that implements (or requires
% implementation in its subclasses via abstract methods or properties)
% most functionality related to ConfigHelper objects.
%
% ConfigHe... |
3a82eca01b037f1956cab35e89996c73178bc2f7232d7d1a739deccb9af59bfa | MATLAB | 1,765 | 64 | classdef zapit_build_tests < matlab.unittest.TestCase
% Basic integration tests of the Zapit GUI with its dummy components.
properties
hZP = [];
hZPview = [];
end %properties
methods(TestClassSetup)
function buildZapit(obj)
% Does Zapit build with dummy parameters?... |
c35864c036b869556bf1312eba5eda6d3dc0d8df4a08c002422c4c0fe0abb419 | MATLAB | 1,768 | 1 | function snd = soundFreqSweep(startFreq, endFreq, duration, samplesPerSec)
% snd = soundFreqSweep(startFreq, endFreq, duration, [samplesPerSec])
% Creates a normalized sound vector (duration seconds long)
% where the frequency sweeps from startFreq to endFreq (on
% a log2 scale).
%
% samplesPerSec is optional- the ... |
27c8eddcf922abd1f476ac397fdb9428e104479a6c3ac49d5707762d1b51a2ef | MATLAB | 1,770 | 68 | function [displayName ok] = selectDisplay(commandLine);
% Present the user a menu to select a calibrated display.
%
% [displayName ok] = selectDisplay([commandLine=0]);
%
% This function provides a dialog to the user with a list of the saved
% displays. (The displays are stored in the VISTADISP repository, in the
% di... |
4891ce591953c59907394f1e8a449e8a39522f1aaf2d9f6ff0a95c61f0fc5d16 | MATLAB | 1,771 | 66 | %% function to project the fMRI phase data (the harmonic data) onto spherical harmonic basis functions defined below:
function timecourse = projectSphericalHarmonics(phas, mask, nsamples)
phas = phas - mean(phas,'all');
phas = phas * 3.0 * 10^-6;
phas = cumtrapz(linspace(0,260,260),phas,4);
s = size(phas);
gridsi... |
6092d729a7a306c6853ae01eab0a5b8a013db8d3d7d91811bae6e5f34233229f | MATLAB | 1,772 | 52 | function checkScannerCalib_Callback(obj,~,~)
% Sweep beam over calibration positions to visually check it worked
%
% function zapit.gui.main.controller.checkScannerCalib(obj)
%
% Purpose
% This is a callback from a state button so it will run the calibration
% check continually when depr... |
0c135294807666ef93d0622eb2c1e7746043c26f9b947037d38a6e573f99829b | MATLAB | 1,774 | 61 | % test out the nidaq by simultaneously outputting on a digital counter,
% an analog output, and recording from analog inputs
cd 'C:\Users\user\multifiber';
devices = daq.getDevices();
device = devices(1);
rate = 10;
fs = rate * 10;
s = daq.createSession('ni');
s.Rate = fs;
s.IsContinuous = true;
camCh = s.addCount... |
5e8d92164a7a0baca8a951aca89a7d8e47e3039b1af963bf31d0424e55c54ef8 | MATLAB | 1,775 | 31 | function examineColorCorrection(roundnum)
%Written for the first splintr barcode dataset from Oz
FILEROOT_NAME = 'exseqautoframe7';
ROUND1DIRECTORY = '/mp/nas0/ExSeq/AutoSeqHippocampus_rename/';
DIRECTORY = '/mp/nas0/kajita/062917_ExSeqAutoSeqHippo_allrounds_mod';
OUTPUT_DIRECTORY = '/mp/nas0/ExSeq/AutoSeqHippocampus_... |
fe33cc5e9d1ce82471e75ed43256f26bc33169df1706cfbc7f3ea5a8b4b4a2f9 | MATLAB | 1,775 | 64 | %io_writejmrui.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% RF=io_writejmrui(in,outfile);
%
% DESCRIPTION:
% Takes MRS data in matlab structure format and writes it to a text file
% that can be read by jMRUI.
%
% INPUTS:
% in = input data in matlab structure format.
% outfile = Desired filename of o... |
27565a2ce56075ea8861fc3a2dc07aa67f8927fc80d96491262463932ad9f489 | MATLAB | 1,776 | 44 | function trappingErrors
% Example - demonstrates the use of try/catch for trapping errors
%
% function trappingErrors
%
% Purpose
% Sometimes you want to ensure that a block of codes fails gracefully in
% the event of an error. You can achieve this with a try/catch statement.
% You will ... |
a9a5c1dec4e74d839b4460188a640395008648bf1cd3106d2fec0c9bc2ff946f | MATLAB | 1,777 | 50 | function output = taft_postprocess_FisherZ(input)
% output = taft_postprocess_FisherZ(input)
%
% Convert betas stored in Fieldtrip object for multiple subjects into
% z-values using the Fisher z-transformation (Matlab's atanh)
% In my experience, this transformation hardly matters for numerically
% small values ...
... |
4c83a15b424933138d48ae7501daa63fd757fd7469ee159411574d5306c4d220 | MATLAB | 1,778 | 54 | function plot_traces_lines(self, traces, hAxTraces, params)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either... |
82dd7db5d247de8ed047b4e2402ec5ab49b40a90c129019220668304bb70852f | MATLAB | 1,779 | 66 | function res = rescale2(mtx,mtxRng,resRng,roundflag)
%
% res = rescale(mtx,[clipMin,clipMax],[resMin,resMax],[roundflag = 1])
%
% Rescales mtx to [resMin,resMax].
% Before rescaling, clips values outside of [clipMin,clipMax].
%
% if roundflag = 1 rounds to nearest integer
%
% [clipMin,clipMax] default is [min(mtx(:)),m... |
b9b6e0861393ec4ab8f81e56eb412f1f9aaa2745c5c47ee655099b84ea7db7f9 | MATLAB | 1,779 | 58 | classdef Test_Data < matlab.unittest.TestCase
%TEST_DATA Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (Constant)
time = [0 1 2]
raw1 = Test_Data.time + 1;
raw2 = Test... |
d30e1a9c5290e74e55170e9f9c1f8ff08b0e67076a038bf28ccacda0fae05e7d | MATLAB | 1,779 | 79 | % Test the delay between an analog output and a digital counter session.
% Set to true to use two separate sessions instead of one
use_separate_sessions = true;
cd 'C:\Users\user\multifiber\tests';
devices = daq.getDevices();
device = devices(1);
rate = 10;
fs = rate * 100;
s = daq.createSession('ni');
s.Rate = fs;
... |
f649850724d20a51889302c80c2fce8880e7a2e2548b0a675c40cfd68e96a6c0 | MATLAB | 1,784 | 49 | %% LFP Plot Example
%
% <html>
% Import streaming LFP data into Matlab using TDTbin2mat <br>
% Plot the power spectrum and RMS of the waveform <br>
% Good for sleep scoring and behavioral discrimination
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories to Matlab
% pa... |
0c8b9def18e64d6faed546c86e9d726982ac66d167eab2eb9f5c8d77598e20a9 | MATLAB | 1,785 | 48 | function ok = run_all
% Run the whole validation suite of the TFCE toolbox
% FORMAT ok = run_all
%
% Requires SPM on the path (for the surface checks) and the compiled mex-files.
%
% ______________________________________________________________________
% Christian Gaser
% ______________________________________________... |
d499a51f869ca96779c3f164e5ad50e872c3c0b3f2fb53b881c79588969cb7dd | MATLAB | 1,785 | 49 | %% LFP Plot Example
%
% <html>
% Import streaming LFP data into Matlab using TDTbin2mat <br>
% Plot the power spectrum and RMS of the waveform <br>
% Good for sleep scoring and behavioral discrimination
% </html>
%% Housekeeping
% Clear workspace and close existing figures. Add SDK directories to Matlab
% pa... |
94beb2283eaa26bb92757a4603e1f990279b876c2a9ddbe17c12e7b76c2043ea | MATLAB | 1,789 | 92 | %% Set parameters
clear; close all; clc
useT = erase(pwd,'Z:\labMembers\TM\Novelty_Analysis\clusterMan\');
anaT = 'norm2other';
ttl = ['Fx-global_' useT '_' anaT];
useFile = ['distsFOVFx_' useT '_global.mat'];
load(useFile)
outType = {'Common','Other','Cross'};
xSet = 1:38;
xN = length(xSet);
XLIM... |
cabf139076f3c5ea85063f0d070186f88ff78c466d4a6e5e472f5f6e5d914353 | MATLAB | 1,792 | 75 | % op_addScans.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_addScans(in1,in2,subtract);
%
% DESCRIPTION:
% Add or subtract two scans together.
%
% INPUTS:
% in1 = First spectrum to add (in matlab structure format)
% in2 = Second spectrum to add (also in matlab structure format).
% subtrac... |
4f272387eb951fd1565f65d9c9d467d7a25f0411599ce946abf39568eeed257f | MATLAB | 1,793 | 39 | function f = LK_PlotNormalizedPowerDuringHCRipples_20231005(dt)
%
% LK_PlotNormalizedPowerDuringHCRipples_20231005 plots normalized power
% during hippocampal ripples.
%
% Input is a structure with multiple fields.
%
% Output is a figure handle.
%
% Lukas Kunz, 2023
% loop through LFP-channel regions
x = dt.foi; % fre... |
7c0e68eca9a29cb1cfaf0e466a1ab9e86311ae1a86b900d779ec99c80c4f2598 | MATLAB | 1,794 | 55 | classdef Test_RawImgHelper < matlab.unittest.TestCase
%TEST_RAWIMGHELPER Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties
end
% =========================================================... |
3e874a7b179a61464f0d211ecec17e5d01fec7c62daac8e1e4b2fdc35984f00a | MATLAB | 1,795 | 53 | function imgLong = reshape_to_long(imgDeep, varargin)
%reshape_to_long - Convert the image to long format
%
% imgLong = reshape_to_long(imgDeep) converts imgDeep to long format.
% That is, the image lines are rearranged into a single, long image
% frame. This is useful when working with image types that are
% ... |
d2d1871458859fb3325041fc1b05cd6aa45de382b8b95bd66c68c1c131889cc7 | MATLAB | 1,795 | 47 | %each column is a variable. each row is a sample
%nIters number of iters of linear regression. if 0 then the mean is used to
%fill missing values
%maxUnknownsEquationsRatio, the unknowns are the coefficients of the linear regression, if there are
%more unknowns then equations then there are infinite number of solut... |
13871076815e9dce92e656313e54bb788d33284e2ba62ddfee1c9a8454a3fe6a | MATLAB | 1,797 | 73 | % GI_TREE Axial conductances of the segments of a tree.
% (trees package)
%
% gi = gi_tree (intree, options)
% ------------------------------
%
% Returns the axial conductances of all elements [in Siemens].
%
% Input
% -----
% - intree ::integer: index of tree in trees or structured tree
% - options ::string:
% ... |
72834dc1b998337210f068d489c2e1bd7c410c46df74b1de13ff1927b3fa58c4 | MATLAB | 1,799 | 52 | % Parameter configuration for TS extraction for resting state fmri
% Parameter configuration for TS extraction for resting state fmri
% _________________________________________________________________________
% Stanford Cognitive and Systems Neuroscience Laboratory
%
% $Id rest_ts_extraction_config.m $
% ------------... |
ff1379d5d6aa87e95f9512aabea3486eb97280e427978dff89a0280af453da6a | MATLAB | 1,799 | 44 | data = ALLEEG.data(1, :, :);
MI = [];
MI_out = [];
% MI_out is struct. For each trial, it has Amp_freqs x Phase_freqs x time points
% Amp_freqs = Amp_min : Amp_step : Amp_max;
% Phase_freqs = Phase_min: Phase_step : Phase_max;
% time points are from the epoch. It seemed that epoch is from -10s to 30s
% MI =... |
2eb55434e2ea5d51d4b299821b0029926ed5fd450913a84caf25efaf293c8ef8 | MATLAB | 1,801 | 49 | function rr = isequal(self, varargin)
%isequal - Test CalibrationPixelSize objects for equality
%
% isequal(OBJ1, OBJ2) tests scalar CalibrationPixelSize objects OBJ1 and
% OBJ2 for equality, returning logical 1 (true) if the two objects are
% identical, or logical 0 (false) if they are not.
%
% isequal(OBJ1, O... |
f28ce4fac6e9c04238416b332b0ff2281258c6442b0bd0ebb5720b1d59de71aa | MATLAB | 1,801 | 70 | function gcaformat(graphicsObject,article)
if(nargin<2)
article = true;
end
if(nargin==0)
nbFormat(gca,article)
elseif(strcmp(graphicsObject.Type,'axes'))
nbFormat(graphicsObject,article)
elseif(strcmp(graphicsObject.Type,'figure'))
axs = get(graphicsObject,'children'... |
7aaabc3999bc3a43eba8b6dc95d104347864102b048819b9153a05e4150c2701 | MATLAB | 1,804 | 53 | %op_CSIgetLW
% Jamie Near, Sneha Senthil, Sunnybrook 2022
% USAGE:
% [FWHM]=op_CSIgetLW(in,Refppmmin,Refppmmax,zpfactor);
%
% DESCRIPTION:
% CSI version of op_getLW
%
% INPUTS:
% MRSIStruct = input spectrum in structure format.
% Refppmmin = Min of frequency range (ppm) in which to search for reference peak.... |
9b0e6032446adb57ce6157aab81e80892cd6cfe4ed4a211994ea5087eef65aea | MATLAB | 1,804 | 49 | function[RowShifts,ColumnShifts] = DetermineXYShiftsFBS(full_vol,...
BlurFactor,KeepingFactor,ReferenceVolume)
% DETERMINEXYSHITS: determine XY shifts per plane with a parfor loop
% Credits: Alex Fratzl, edited by Fred Shipley
%
% Inputs:
% full_vol -- 4D matrix of uint16 or other, dim (x,y,z,t)
% Bl... |
a1dffeb526d7629fcdf6a9f8c3e036a0868d4af3ebc1e0b1740a83ed0edf251f | MATLAB | 1,804 | 65 | function varargout = plot_trajs(self, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 o... |
e94f5c3656812edff00459d7f5eefa19daedf6cc41e0da3380eac0d68c082b67 | MATLAB | 1,805 | 43 | % getKPtsPerCycle.m
% Brenden Kadota, Sunnybrook Research Institute 2021.
% Jamie Near, Sunnybrook Research Institute 2024.
%
% USAGE:
% kPtsPerCycle = getKPtsPerCycle(kTable)
%
% DESCRIPTION:
%This function accepts as input a "kTable" (the output of the function
%'readkFile.m' for a rapid MRSI seuqence and returns t... |
39d29f20ba27cabaf9b98695a4d54980a41650823630462a03cad6420d594b50 | MATLAB | 1,806 | 81 | % SHINE Add some effects on current axis.
% (scheme package)
%
% shine (options)
% ---------------
%
% Polishes the graphical output. By default simply adds a camera light
% (therefore the name "shine"), which typically sets the figure renderer to
% opengl as a side effect.
%
% Input
% -----
% - options ::string:
% ... |
b4e7892f19bd6b599abbd1cd6308424c8b32c0a25983d83df94d2f6e24fbcd96 | MATLAB | 1,806 | 66 | function varargout = plot_diam_profile(self, objPI, hAx, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation,... |
f6d66f7010c03e8a86f93f92677fdf9b553383cb3a318e2703a9723bb4f032fb | MATLAB | 1,806 | 48 | function varargout = funRawHyperbola(zoomIn, params)
%funRawHyperbola - A two parameter rectangular hyperbolic function
%
% PXSIZE = funRawHyperbola(ZOOM, PARAMS)
%
% PXSIZE = PARAMS(1) ./ ZOOM + PARAMS(2);
%
% where PXSIZE is the calculated pixel size, ZOOM is the supplied values
% for microscope zoom fact... |
c8c5f42beb283e391deb6777095e6477ee977bc3ae4bbac66745229ea0f94ae5 | MATLAB | 1,807 | 60 | % the pattern separation toolbox: analyse spike train ensembles
% Copyright (C) 2022 Alexander D Bird
function [binned_spikes,max_time]=bin_inputs(input,input_code,binsize_ms,wordsize)
if nargin<4 || wordsize
wordsize=5;
end
n_trial=size(input,1);
% Determine last spike
max_time=0;
for ward=1:n_trial
... |
e677aba2b23f680b76b75c686a1aa7a735100d9bcc2bd0f67168ef7761b6f6e5 | MATLAB | 1,808 | 53 | function newCh = sparse_ratio(c1, c2, varargin)
%sparse_ratio - Calculate ratio of channels using "sparse" method
%
% sparse_ratio(CH1, CH2) applies a threshold before calculating a new
% channel based on the ratio of two existing image channels. Pixels from
% either channel that are below the threshold are repla... |
5e895160c16a5322ead9bf1369cfacb85d780fa543dd20a9d00148e368c8e4c2 | MATLAB | 1,809 | 73 | % T_TREE Termination point index in a tree.
% (trees package)
%
% T = T_tree (intree, options)
% ----------------------------
%
% Returns a binary vector which is one only where there is a termination
% node (exactly none child). Termination point indices are then find (T).
%
% Input
% -----
% - intree ::integer: ... |
9fbe0504d0379f64e02bb2adfe18edab34b2a2955e6a9640aaa0cd597ad74bce | MATLAB | 1,811 | 65 | function varargout = plot_ref_helper(self, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either versio... |
6869d0d1bcb2f663d9a982f3c3ec81828c5edc46dd215e4995845d70922b3e1f | MATLAB | 1,814 | 54 | function ppOpt = gaussian_peakfit(cc, lags, nPixelsToFit, varargin)
%gaussian_peakfit - Helper function for Gaussian peak fitting
%
% This function is not intended to be called directly.
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute i... |
e5d40ad09e55a9fe82b43a31a1eb93c556acac3ede027e7cbd3b06d3699a49ed | MATLAB | 1,814 | 65 | clear
clc
close all
%% Figure7
subs=30;
frequency=1:60;
condition=2;
blocknum = 12;
channum=64;
snr_subs=[];
home_path=[pwd,'\temporary data\topo64_data\'];
for subnum=1:subs
filename=[home_path,'snr_',num2str(subnum),'.mat'];
load(filename)
snr_subs(subnum,:,:,:)=snr;
end
eeglab;
load(... |
e76773a42fdcf761aed4945ac0a9e2435714ed1980126b81e01f79b549c67546 | MATLAB | 1,815 | 62 | function [tf, numWorkers] = is_parallel()
%is_parallel - Determine if a parallel pool currently exists
%
% tf = is_parallel() is a utility function that returns a logical value
% specifying whether a parallel pool currently exists.
%
% [tf, numWorkers] = is_parallel() also returns the number of workers in
% the... |
eb2204099ccf56ec35392cb8cb5f4356157ed0eb73bf0905401c630dbe799f07 | MATLAB | 1,815 | 59 | function ydot = rhsDynEqs( t, y )
% Computes r.h.s. of the dynamical equations (rate of change) for the
% membrane potentials and NMDAR gating vriables.
%
% Input
% t - time
% y - membrane potentials and NMDAR gating variables at time t
% Output
% ydot - rate of chan... |
6b1343e015288ea348caed7e4d692bad2d5aefa082506ceeed9761265685faf7 | MATLAB | 1,816 | 56 | %%% parameter_sweep.m
%%% Omkar N. Athavale, May 2023
%%% Perform equally spaced parameter sweeps for one or two changing variables
% --- INPUTS ---
sweep_var = [1]; % variable index to sweep (max 2)
sweep_domain = [0 10]; % range to sweep (all variables same)
n = 2; % number of points to sweep (all variables same)
f_... |
b00aa08b52449ad5b59490136583eeb9e80f2e524a16071d6b7207ddce2ee04a | MATLAB | 1,816 | 51 | function tf = has_ch(self, chNames)
%has_ch - Determine if particular channels are present
%
% TF = has_ch(OBJ, CHNAMES) returns a logical array that is true
% where the elements of CHNAMES are channels in the MetadataObj and false
% where they are not. CHNAMES must be either a single row character
% array or ... |
88fa0eef87b19f7a8da174a301d84b8296295f47c96bd3aef589082860e4e9ad | MATLAB | 1,818 | 52 | clc;clear;close all
%%
% Read the matrix from the CSV file; first column is t-statistic, second is p-value
p_t_result = readmatrix("t_p_old_vs_young.csv");
% Extract the third column from the matrix
p_vec = p_t_result(:,3);
%%
% Calculate the negative log10 of the p-values
nlogp_vec = -log10(p_vec);
Wp = squa... |
3e866e2c0545b8d95589cde7b516378f9327696d4cfbc1e70581e74e55870987 | MATLAB | 1,819 | 51 | function [roiRGB, axonRGB, roiLabel] = VisualizeSegmentation(expt, ROI, varargin) % sbxPath,
IP = inputParser;
addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'ROI', @isstruct )
addOptional( IP, 'axon', [], @isstruct )
addParameter( IP, 'overwrite', false, @islogical)
parse( IP, expt, ROI, varargin{:} );... |
5f55e86389c6ac5918467eb4530f04cd79aca3d8879313e3693998b84e79601d | MATLAB | 1,822 | 43 | function f = LK_PlotRippleERPAcrossChannels_20231030(dt)
%
% LK_PlotRippleERPAcrossChannels_20231030 plots the ripple ERP across
% multiple channels.
%
% The input is a structure with multiple fields.
%
% The ouptut is a figure handle.
%
% Lukas Kunz, 2023
% create figure
f = figure('units', 'centimeters', 'position',... |
aa50c64cbcac8d25329080fb8ad0f55fab2f83af35aac204dc750a9a76f8ee99 | MATLAB | 1,822 | 56 | function [DataMatrix, Labels,MouseIDs,Days, sessionNames] = GetImputedDataMatrix(dataFileName)
DataMatrix = [];
Labels = [];
sessionNames={};
curFname = dataFileName;%'C:\David\Phd2020\ElectordesClassification\Data.xlsx';
[~,sheets] = xlsfinfo(curFname);
if length(sheets)>1
disp([num2str(length(sheets)),... |
3ce5bc5582281ceb29c0da8b53dd1c8c59f22a5d43f98950cf5f7de5fc962f3b | MATLAB | 1,823 | 77 | function y = padcrop(x,szIn,dim)
%
% res = padcrop(x,szIn,dim)
% Changes size of x along dimension "dim" by either zero padding or cropping around its center
%
% (c) Corey Baron 2015
%
if numel(szIn)>1 && nargin>2
error('Incompatible inputs: with dim supplied, szIn should be an integer')
end
if nargin<3
dim... |
4e3dc99f3e07bb231e40078d388840874470e13901be4ccd6a130108554cc982 | MATLAB | 1,823 | 38 | %% System Requirements
%
% CHIPS has been tested on computers running Windows, macOS and several
% Linux distributions, using MATLAB versions R2013a and newer. CHIPS is
% also expected to run in earlier MATLAB versions; however, this cannot be
% guaranteed since the unit testing framework did not exist prior to
% R201... |
1be88cc4140c95c2c2e2c83ead10f3a18c74410fca6d94e922591f1fdda45e40 | MATLAB | 1,825 | 75 | % B_TREE Branch point indices in a tree.
% (trees package)
%
% B = B_tree (intree, options)
% ----------------------------
%
% Returns a binary vector which is one only where there is a
% branching point (> one child). Branch point indices are then
% find (B).
%
% Input
% -----
% - intree ::integer: index of ... |
d5ff98f60951d995a73aa603df9a0beea77f5633ebdd61071d8582deaf563c8b | MATLAB | 1,825 | 48 | get_headstage_source
if strcmp(headstage_source, 'eCube')
eval([headstage_source '_64ch_headstage']) % whitematter provide the mapping from probe to HS, so there is no pcbwiring
else
if size(probewiring,1)==64
eval('wiring_64chPCB');
eval([headstage_source '_128ch_headstage'])
hea... |
0ac2472c97b00e10be57af38223e7085c8dfcd75c8a031c6cd2ad2a13048b3d1 | MATLAB | 1,826 | 91 | %% Default values
%
%
% YC at ES lab
% Created on Nov. 5, 2006
% Last modified on Sep. 4, 2012
%% Options
sOptOptm = ...
optimset('LargeScale','On', ...
'TolFun',1e-8,'TolX',1e-8, ...
'MaxFunEvals',1e4,'MaxIter',1e4);
OptOptm = sOptOptm;
Options = sOptOptm;
OptionsOptimize = sOptOptm;
sOptInpu... |
dcd6f9ef2f6025d678ccc0596394cfe2c576b8a57d39c8fcf6561d73e03c226e | MATLAB | 1,826 | 52 | % Parameter configuration for TS extraction for resting state fmri
% Parameter configuration for TS extraction for resting state fmri
% _________________________________________________________________________
% Stanford Cognitive and Systems Neuroscience Laboratory
%
% $Id rest_ts_extraction_config.m $
% -------------... |
c668cf518e4b4339e5e7a94171ca51ae4f7c42661aeb0f551e58711f6ee53ced | MATLAB | 1,829 | 44 | function download_example_imgs(varargin)
%download_example_imgs - Download the CHIPS example images
%
% download_example_imgs() downloads the example images for CHIPS from the
% University of Zurich website to the subdirectory tests/res within
% the CHIPS root directory (as returned by utils.CHIPS_rootdir). For
... |
b275a6a511842e3ea10774ccb99c7248ba6bb34369ad3a1c11e6810487edd929 | MATLAB | 1,831 | 66 | function live2pStimSocket
global ExpStruct
global websocket
seqNum = numel(find(diff(ExpStruct.triggerPuffer)==1));
if seqNum > numel(ExpStruct.bigListofSequences)
sendThis = [1000];
sendThisSI = [];
elseif seqNum ==0
disp('0 trials')
sendThis = [];
sendThisSI.times = ExpStruct.bigListOfFirstSti... |
c3e6519082240fc5f74129743f436d1189ec94e5dc421a0d57d3a1732fa0513e | MATLAB | 1,836 | 64 | function varargout = plot_default(self, objPI, hdlGraphsTime, varargin)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Founda... |
e76794eb2d688994826776583c4e6807b09196c7c7a3ddfb93c2e93206054017 | MATLAB | 1,839 | 43 | function self = post_process_velocity(self, pixelSize, lineTime)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, e... |
94d36c739f456e67511379aa6d4781d74798a9ab34ab0df3a761452335ddc4ca | MATLAB | 1,841 | 71 | % C_TREE Continuation point indices in a tree.
% (trees package)
%
% C = C_tree (intree, options)
% ----------------------------
%
% Returns a binary vector which is one only where there is a continuation
% node (exactly one child). Continuation point indices are then find (C).
%
% Input
% -----
% - intree ::integ... |
087a0722ef6cd1d0d752265a759a0a30045f95deb925ead28f67c97ff1fe72d2 | MATLAB | 1,845 | 38 | %% View CSD effects for all 3D data
ViewCSDdeform = figure('WindowState','maximized');
showVars = {'fluor', 'scaleMag', 'shearMag', 'shiftZ'};
showLims = struct('fluor',[0,5], 'scaleMag',[0,5], 'shearMag',[0,0.01], 'shiftZ',[-3,3]);
opt = {[0.01,0.01], [0.05,0.03], [0.06,0.02]}; % {[vert, horz], [bottom, top], [... |
155f54e6c43a42f55ed27c440c872c75d0a2df9451ded2143c534f0cecc9d46d | MATLAB | 1,846 | 42 | function generate_images()
%
% addpath(genpath('TOOLBOX_DIR/BrainNetViewer_20191031/'))
addpath(genpath('/Users/zhangyuan/Desktop/Sherlock/toolboxes/vistasoft/'))
niis_dir='/Users/zhangyuan/Desktop/Sherlock/projects/menon/2021_HCP_Gender/results/restfmri/dnn/niis/consensus_multiple_cv/fm_intersect_n... |
b1d71e65a438174f1f8c67384ecea9aa15abb2943a6fbd05534e0139f3cf82d6 | MATLAB | 1,846 | 76 |
function L = laplacian(DATA, TYPE, options)
% Calculate the graph laplacian of the adjacency graph of data set DATA.
%
% L = laplacian(DATA, TYPE, PARAM)
%
% DATA - NxK matrix. Data points are rows.
% TYPE - string 'nn' or string 'epsballs'
% options - Data structure containing the following fields
% NN - integ... |
e34354edc564718274aa2084fafd65f9fb668f8e73d90ee4d5ea62917b3919c2 | MATLAB | 1,848 | 107 |
clear
close all force
warning on
imSize = [733, 977];
load('a0_0_bhv2trialStrct.mat');
NIm{1} = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
49
52
53
55
56
57
59
60
];
%
NIm{1} = [7
11
25
27
38
39
40
47
49
53
56
60
];
%}
for iN = 1:numel(NIm)
NIm{iN} = [NIm{iN}... |
2ca4ec23fb13f805bd0c1c5ee3050dbb44345788e85733005b67175e5c8a6abc | MATLAB | 1,849 | 58 |
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
V = round(pix2deg*2);
W = round(pix2deg*2);
S = imSize;
M = S(1) - mod(S(1), V);
N = S(2) - mod(S(2), W);
MV = M / V;
NW = N / W;
sigXY = pix2deg * .25;
load('a0_0_bhv2trialStrct.mat');
hWB = waitbar(0,'checking the trials ...');
nImage = nu... |
757e4819833d447c69d127cdc17bd1cec69982f00889cb121aea841a84c66b67 | MATLAB | 1,850 | 52 | function [self, puffBoolean] = detectPuffingPixels(self, normFiltSeq, ...
frameRate)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Fre... |
472dd82bdfd47275030821bf39e86a7710bd4826fdfc65b35ab663ac60561275 | MATLAB | 1,851 | 57 | function map = colormap_helper(map, len, lims)
%COLORMAP_HELPER Helper function for colormaps
%
% Examples:
% map = colormap_helper(map);
% map = colormap_helper(map, len);
% B = colormap_helper(map, A);
% B = colormap_helper(map, A, lims);
%
% Given a concise colormap table (i.e. one that contains all the
% i... |
b3223f26bf8c3f8edf4709bd196ba1197072ab24f06634618f7c5892fdd1155b | MATLAB | 1,852 | 51 | %% Gradients O-information analysis of US econometric time-series
clear; clc
%% Load dataset
load Serie_MacroEconomiche.mat
DataTable = DataQuaterly; % DataQuaterly DataMonthly
Description([17 21 24 28],:) = [];
Data = rmmissing(tick2ret(DataTable,'Method','continuous'));
Data = Data(1:244,:); % Escludi... |
fe4e28ee0620edb949b430280ab8ccc47f782d0eedb5a95e71cfece9e2ae8dc7 | MATLAB | 1,852 | 66 | function Par = LoadPar(FileName, varargin)
% LoadPar(FileName)
% loads the specified par file and returns a structure with these elements:
%
% .FileName -> name of file loaded from
% .nChannels -> number of total channels
% .nBits -> number of bits of the file
% .SampleTime -> time, in microseconds,... |
660d92281d2eee04e0f7223a5bc623fd763330093ddc4e3e6d74916561146a88 | MATLAB | 1,856 | 59 | function [spmat, spt, spc] = CellsortFindspikes(ica_sig, thresh,...
dt, deconvtau, normalization)
% [spmat, spt, spc, zsig] = CellsortFindspikes(ica_sig, thresh, dt, deconvtau, normalization)
%
% CELLSORT
% Deconvolve signal and find spikes using a threshold
%
% Inputs:
% ica_sig - nIC x T matrix of ICA ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.