sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
31da099e22ba00767348a3bc5adb9b7037f416e9cf7cc1ce986813eb61cdd272 | MATLAB | 2,988 | 132 | clear
imSize = [733, 977];
pix2deg = 34.910;
load('a7_2_createAvergedNOTMorphedHeatMapsLoad.mat', 'hmAll')
load a0_0_bhv2trialStrct.mat
%%
%hmAll = zeros(733, 977,nMuscimol, nMonkey, numel(NIm), 'double') from a7_2;
% UMuscimol = [0, 12 (r),9(l) ,4,1];
%iMuscimol =
%1: base
%2: right face patch
%3: ... |
5f9e2973a2c7b99d05da6e8a49786d7eb8e252f65377199e41c534c834b778af | MATLAB | 2,989 | 77 | % overlay_conc
%
% callback on mouse down event on spm_image figure
% should display concentration maps on mri
%
% INPUTS:
% in: CSI object
% met: metabolite array
% X: (1,2) vector with the first and last index of x coordinates
% Y: (1,2) vector with the first and last of y coordinates
function overlayConcMapOverMRI
... |
9a88726fd7126ed37899c04b4b90009ec8ecd1ef2ada784881be4a88d9185e76 | MATLAB | 2,990 | 81 | function [ figHandle, colorFlag ] = PlotImagingStruct( imagingStruct, colorFlag )
% PLOTIMAGINGSTRUCT takes either an up to 3 channel image or an
% imagingStruct and plots it appropriately
if isstruct( imagingStruct ) % if imagingStruct is a true imagingStruct
I = imagingStruct.stackRaw;
I = nanmean( I, 3 );
... |
eb3c1b8121ee3b63faba70e17654c43c2611486ee9396185d3efbd99e3cfd8d0 | MATLAB | 2,990 | 54 | %% compare different cell types
% load the data
clear;clc;
goodF.R = [0,1,1,0.923100000000000,1,0.800000000000000,0.666700000000000,0.800000000000000,1,1,0.750000000000000];
goodN.R = [0.647100000000000,0.680000000000000,0.636400000000000,0.800000000000000,0.533300000000000,1,0.400000000000000,0.727300000000000,0.7... |
e607f80a1c2a85cbd386a556adfc8575ebeaa1aa68b09d06e1511e96d7a3c0a8 | MATLAB | 2,994 | 85 | classdef Test_CalcDetectSigs < matlab.unittest.TestCase
%Test_DetectSigs Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties
end
% =========================================================... |
290c597f2dd40532d7d231ff590390b36b5bfdbc69c836d6d787dc3ed2400cac | MATLAB | 2,995 | 87 | function varargout=pt_continuousabove(data,baseline,abovethresh,mintime,maxtime,ignorepts)
% function varargout=continuousabove(data,baseline,abovethresh,mintime,maxtime,ignorepts);
%
% Finds periods in a linear trace that are above some baseline by some
% minimum amount (abovethresh) for between some minimum amount of... |
53efbcecc967e3b941e41b65cf1cc54da874ca96cdf53222293004e7b8a530ce | MATLAB | 2,996 | 80 | function singlePulse
% Example showing how to create a single pulse on a digital output channel with a timer using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.CO.singlePulse
%
% Purpose
% Shows how to flip a single digital line high for a brief period after a fixed delay
% with a co... |
b87859633db8bb321de733f80d9372bb172974190efa2c0749185849cbe9a3a7 | MATLAB | 2,996 | 135 | % this code will read all the gaze files from the trials and covernt them
% to the image coordinate.
clear
close all force
warning on
hWB = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
load('a0_8_timingLeftVsRight_SacExcluded.mat')
%%
nTrialAllNext = 0;
iTrialAll = 0;
... |
e295ee853cfde3e70fb213052102e99ab82951722251a06894888003a6759fe6 | MATLAB | 3,001 | 68 | function [PSD_OfFirstAnalyzedChannelNP,PSD_OfSecondAnalyzedChannelNP,LFPNP_PSD_TimeBins,LFPNP_PSD_FrequencyBins,...
NoiseTimePointsFirstChannelNP,NoiseTimePointsSecondChannelNP,FirstAnalyzedChannelNP_AreaName,SecondAnalyzedChannelNP_AreaName]...
=Analyze_LFP_NP_data_02_02_2023(filenameLFPNPData,NP_Channels,Star... |
7a8776d154cfdb39a81c7e7c69116a9a839090e2026062a2845fe0dd68b7fa03 | MATLAB | 3,002 | 92 | function [experiments] = loadDataMT()
% Get listing of raw data files
D = dir('./dataPhysio/MT/DispTunRaw*.mat');
experiments = {}; % initialize
% load meta-data to grab RF eccentricities
T_MT = readtable('./dataPhysio/MT/metadataMT.xlsx');
cnt = 1;
% for each data file
for k = 1 : numel(D)
% load it
load(... |
c458b42b92ebb3b6b5236715ba56eb8eede362731f56e4ee03e4d48817c887f7 | MATLAB | 3,002 | 92 | function plot_window(imgSum, peakLocs, xp, window, theta, maskRBC, ...
pixelSize, windowTime, 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 publi... |
13b498eba5dbc470c5a65ee688357328eac8300887b859df9bd2c21ba18e6823 | MATLAB | 3,003 | 88 | function [dictmatchidx,minEditDist] = shaharTieSeconds(transcript,transcript2,confidence,dictionary,confThreshChange, confThreshFixed,editScoreMax)
%Pass in the cropped transcript and confidences, ie excluding primer rounds
L = length(transcript);
%First, find the best match
hits = (dictionary==transcript);
hammings= ... |
2138f83b69a4b11b403b42b409806a56726a72b121c822bf8c266a6f69e2d08f | MATLAB | 3,008 | 134 | %% plotLocationConsistencyFig
clear all; close all; clc
%% Load RBRLoc by group
load('RBRLocComb_good.mat'); %mean of the consistency as a function of track location
locG = RBRLocComb;
meanRBR = cellfun(@(x) mean(x,1,'omitnan'),locG,'UniformOutput',false);
semRBR = cellfun(@(x) nansem(x,1),locG,'UniformOu... |
5bea62ab6f7286ccadb3283506261744f0562934809dfe5b6f0e554ab0bd2919 | MATLAB | 3,011 | 67 | function install_denoise(varargin)
%install_denoise - Install the files required for denoising
%
% install_denoise() installs the files required for denoising from the
% Tampere University of Technology website to the subdirectories BM3D and
% invansc within the CHIPS root directory (as returned by
% utils.CHI... |
c73ee507b250ec0dba6b05f3af861adb33a3c73b91391f12c4fada50379e7eed | MATLAB | 3,013 | 82 | function [info, expt] = ConcatenateRunInfo(expt, runInfo, varargin)
IP = inputParser;
addRequired( IP, 'expt', @isstruct )
addRequired( IP, 'runInfo', @isstruct )
addParameter( IP, 'suffix', 'sbx', @ischar )
addParameter( IP, 'overwrite', false, @islogical )
parse( IP, expt, runInfo, varargin{:} );
suffix = I... |
f29fe3b0ecf41dfbdbd9954236b795271de071e0cc15b545d322bf89902d0af6 | MATLAB | 3,016 | 87 | function install_zip(zipurl, dirName, varargin)
%install_zip - Install files from an online zip file
%
% install_zip(ZIP_URL, DIRNAME) copies all files from the online zip file
% specified by ZIP_URL to the subdirectory DIRNAME within the CHIPS root
% directory (as returned by utils.CHIPS_rootdir).
%
% install_... |
9b6f0f58403750ba19aebc715ae43889b5bdea405025c68cb37afef68ee72360 | MATLAB | 3,017 | 96 | % this is time inside eye boundary, see a0_11_insideFace2
load('a0_11_insideFace.mat')
clear
close all force
warning on
imSize = [733, 977];
imSizeCent = fix([733, 977]/2);
y1 = imSizeCent(1)+(-130:70);
x1 = imSizeCent(2)+(-120:0);
y2 = imSizeCent(1)+(-130:70);
x2 = imSizeCent(2)+(0:120);
hWB = waitbar(0,'checking ... |
b391de58f16e61056e11472f09e8a35be6552f5a73cc02f30e0bbc9f50f6430b | MATLAB | 3,017 | 51 | % For each ROI, get the tuning angle from the GLM. Gather stretch and
% activity around this angle (+/- 30?) and fit the stimulus-response curve
% to a sigmoid
dTheta = pi/6;
modelSig = @(b,x)( b(1)./(1+exp(-(x-b(3))/b(2))) + b(4) ); % beta = [factor, growth rate, threshold, constant response offset]
sigmFit = cel... |
33c564ec2dc1c5a9d012af036d9b7c109ffc8432e89b824561dc8f44f84229fc | MATLAB | 3,020 | 108 | function varargout=listDeviceIDs(varargin)
% List the IDs of all connected National Instruments devices
%
% function vidrio.listDeviceIDs
%
%
% Purpose
% Print to screen the IDs of all connected NI devices.
%
%
% Inputs (optional)
% deviceName - [string] The fun... |
75e518b8c64bbd615d024350780326e239c1282fa592935dd542ddb0db112714 | MATLAB | 3,020 | 90 | function [dirs] = set_dirs(rootDir)
% Set directories for EEG pre-processing and analyses based on root
% directory. Add paths for Fieldtrip.
%
% INPUT:
% rootdir = root directory relative to which paths are initialized
% (default '/project/3017042.02')
%
% OUTPUT:
% dirs = structure with di... |
ade51ba9613289f5f2e002dfbe13e822b39c1c98c2218120c97a17bf7ed1af74 | MATLAB | 3,024 | 80 | classdef DataFindROIsDummy < DataFindROIs
%DataFindROIsDummy - Data from dummy ROI identification
%
% The DataFindROIsDummy class contains the data generated by
% CalcFindROIsDummy.
%
% DataFindROIsDummy public properties inherited from Data:
% mask - A mask combining all of the other masks
% means ... |
19ac7ce0b4b250be06cdacae06ecdf35b66030f97625829511b9bebf470d3eb3 | MATLAB | 3,027 | 84 | classdef clrsPT
% Paul tol vibrant colour scehem
properties (Constant)
qualitative_CM = struct('blue',[0,119,187]/255, ...
'cyan',[51,187,238]/255, ...
'teal',[0,153,136]/255, ...
'orange',[238,119,51]/255, ...
... |
e45b8c3b444c6b93ac51fe541fb43591be89127f92a255ccfb43c6af30ee5235 | MATLAB | 3,030 | 96 | % 'plot_raster' Plotting function to visualise spike train ensembles.
%
% (pattern separation toolbox)
%
% plot_raster(spike_ensemble)
% --------------------------------------------------------------
%
% Input
% -----
% - spike_ensemble: Nx1 cell array of input spike times or voltage vectors, where N
% is th... |
01deed6ce5207ca896300c119c9cfaa0ea4f1d14fddda08519eaa00af8d1886e | MATLAB | 3,040 | 103 | function result = makematrices(r, makeords)
import zapit.yaml.*;
result = recurse(r, 0, [], makeords);
end
function result = recurse(data, level, addit, makeords)
import zapit.yaml.*;
if iscell(data)
result = iter_cell(data, level, addit, makeords);
elseif isstruct(data)
result = iter_struct(data, l... |
55a700eb7683a968b71eeadbb696b0f514428ab4352e1e6419ec4c6fa056926a | MATLAB | 3,041 | 82 | function [ stimSize, sortedFieldNameInds, fieldNames, stimParamsFlat ] = StimulusDomain_ND( stimParams, fieldNamesToUse )
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
if HasBlankEpoch( stimParams )
stimParams = stimParams(2 : end);
end
stimParamsFlat = FlattenStruct( st... |
34f58903ad39d05ea78f57e474cee0e0f91d55866b125aa759bb4f87b32f905b | MATLAB | 3,044 | 84 | %%
% Reproduces the minimal distance to the ensemble plot (Fig. 2A)
%
% Function inputs:
% cellTable: structure containing neuron data
% cellCond: a vector of 1's and 0's that denotes which cells should be
% included (e.g., only non-offTarget cells)
%
%%
function Fig2A(cellTable,cellCond)
%% We must average... |
bcb9069b38688db01bac1a9ecf38f31e703d19b9df45b776edb79dbab7203943 | MATLAB | 3,046 | 75 | % Load NY head model
[sa,X] = network_simulation_beluga.getHeadModel;
idcs = sa.cortex2K.in_from_cortex75K;
czIdx = find(strcmp(sa.clab_electrodes,'Cz'));
% Note: different simulation from published figure
load(fullfile(dataFolder,'simulations','example_simulation','simulation','simulation_data.mat'));
% Compute loca... |
1f9547f451f6ec630c5ae84c89194e5fffd4cd4069b47c2f51babd9db4ebfbfa | MATLAB | 3,048 | 97 | %==========================================================================
% This script provides a simulation to illustrate the coactivity z-score.
%
% References: Sosa et al., Neuron, 2020.
%
% Lukas Kunz, 2022
%==========================================================================
% start
clear; close all; clc... |
3da8f188f6676c0bdfd91b4e8a4c812c8ce7be4036e0b9c05ed55aa8584fd4da | MATLAB | 3,056 | 114 | function varargout = plot_main(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 of... |
08b9cc3a23dd37ead9b0f821e37d4838e54d76c1aafe99722118bf631efdddce | MATLAB | 3,059 | 89 | function taft_save_BOLD_HRF_per_trial(ROI2use)
% taft_save_BOLD_HRF_per_trial(ROI2use)
%
% For selected ROI, loop over subjects, initialize TAfT job, upsample
% volume-by-volume data, epoch to trial-by-trial data, save to disk.
% Mind adjusting the root directory.
%
% INPUTs:
% ROI2use = string, 1 ROI to upsampl... |
411ca5c5d94af48d807938e6e14b4fd50f4764ebf41cdd9f82ed0fceaecac818 | MATLAB | 3,059 | 72 | function MultiChImgObj = from_files(varargin)
%from_files - Create a MultiChImg object from a list of files
%
% OBJ = MultiChImg.from_files() prompts for all required information
% and creates a MultiChImg object from existing files.
%
% OBJ = MultiChImg.from_files(RAWIMGTYPE) loads the files into object
% of t... |
0ee551f57a7546787f6fc38e4fdd558e7f8ab5f9fbb7f8dc149f6c24f1508839 | MATLAB | 3,068 | 268 | %first column = channel number on probe.
%second column = channel number on the probe PCB connector for the head
%stage, assuming the HS will be plugged in from the top.
%third column = channel number on the probe PCB connector for the head
%stage, assuming the HS will be plugged in from the bottom.
pcbwiring=[
1 ... |
c7e0eee85f7aa17b96af794ad68216d0f19d28a566e28a499f9260b0f7c60277 | MATLAB | 3,069 | 82 | %%
% New pre-processing step (added May, 2022)
%
% Remove cells from analysis on the current trial if they were an
% offTarget on the previous trial
%%
function [All] = prevOffTargetRemoval(All)
numExps = numel(All);
%% Loop through all experiments
for ind=1:numExps
unIDs = unique(All(ind).out.exp.stimID);
t... |
f6ca7c8e79caf2a61aa25d06159dad4605479d4fdf7857e1266306dc7cf72084 | MATLAB | 3,071 | 108 | % ALLBCTS_TREE Outputs all possible trees with N nodes.
% (trees package)
%
% [BCTs BCTtrees] = allBCTs_tree (N, options)
% -------------------------------------------
%
% Outputs in BCTs all possible non-isomorphic BCT strings with N nodes. On
% demand, cell array of trees BCTtrees is calculated that correspond
% t... |
3b596a0c90ec29d3a1874987b7dd141994bff2bd88a92e967456014b11a86623 | MATLAB | 3,075 | 72 | function ArbLineScanObj = from_files(varargin)
%from_files - Create an ArbLineScan object from a list of files
%
% OBJ = ArbLineScan.from_files() prompts for all required information
% and creates an ArbLineScan object from existing files.
%
% OBJ = ArbLineScan.from_files(RAWIMGTYPE) loads the files into object
%... |
5cbf75fc9b78017bea888155bd4ac598a980b77127832cb7b37ff81df3278a00 | MATLAB | 3,075 | 132 | % this code will read all the gaze files from the trials and covernt them
% to the image coordinate.
clear
close all force
warning on
hWB = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
load('a0_8_timingLeftVsRight.mat')
%%
IFaceNumber = cellfun(@(x) size (x,1), timeOnEye... |
80520952317f2aa7696347c995f1f73fbf5551015ad9a1a3b6fa1f4cdce19c17 | MATLAB | 3,075 | 74 | %%==========================================================================
% This is the function part of codes for help rejection model proposed by Gao, X., Jolly, E., Yu, H., Liu, H., Zhou, X., & Chang, L. J. (2020). The hidden cost of receiving favors: A theory of indebtedness. BioRxiv, 2020-02. doi: https://doi.o... |
7430d3b7eaa6844083ad80a911c0542bab9f8ccb9f62501179d63dd593ca8fcf | MATLAB | 3,077 | 76 | function loadStimConfig_Callback(obj,src,~)
% Load stim config on button press
%
% zapit.gui.main.controller.loadStimConfig_Callback
%
% Purpose
% Loads stim config on button press and add to the list of previously loaded files.
% Note this callback is triggered by loading of recent files al... |
9690bc3441f14ab4f714b5ff2fe8838c8a2f32021a7d04cc44c74fe8093d7151 | MATLAB | 3,078 | 102 | function out = LK_TransitionMatrixForBipolarMontage_20210627(labelold)
%
% LK_TransitionMatrixForBipolarMontage_20210627 computes the transition
% matrix to convert the EEG data into a bipolar montage.
%
% The transition matrix follows the fieldtrip standard: the rows are the
% new labels, the columns are the old label... |
c88cab2fbed19a318f943a59425d2984e22d220990dd5852a9d149bc2ddc2d43 | MATLAB | 3,081 | 68 | function conditionsExceedingLaserPower = checkLaserPower(obj)
% Flag any stimulus condition that needs more laser power than the hardware can deliver
%
% conditionsExceedingLaserPower = zapit.stimConfig.checkLaserPower()
%
% Purpose
% For each stimulus condition we work out the peak laser power ... |
217969b1b351c99c0a3d9363f86ba657e5be85dcf84595f73f6f1c8404a82cbb | MATLAB | 3,087 | 72 | function CompositeImgObj = from_files(varargin)
%from_files - Create a CompositeImg object from a list of files
%
% OBJ = CompositeImg.from_files() prompts for all required information
% and creates a CompositeImg object from existing files.
%
% OBJ = CompositeImg.from_files(RAWIMGTYPE) loads the files into objec... |
d8dda5ee01ecc8daed61db3c62b6c5de5384812c26afa8c0581bde94531d0f07 | MATLAB | 3,093 | 110 | %% Fig1
% Jiaxin Gao
% Zhejiang University
% email: jiaxin_gao@zju.edu.cn
%% Code for Fig 1B
% exp1
clear
clc
load('.\Fig1_data.mat')
v_sum = Fig1_Data.B.v_ane_exp1;
for ind = 1:size(v_sum,3)
v = v_sum(:,:,ind);
[ms1(:,ind),f]=Modulation_Spectrum(v,200,'log');
end
ms_rms1=sqrt(mean(ms1.^2,2));... |
05080f8e21396374a3a061a93c07bf11212eecdb2206ba8d50bdaad3e218bf2d | MATLAB | 3,105 | 78 | %% Export Continuous Data To Binary File
%
% <html>
% Import continuous data into Matlab using TDTbin2mat <br>
% Export the data to a binary file (f32 floating point or 16-bit integer) <br>
% Channels are interlaced in the final output file <br>
% Good for exporting to other data analysis applications <br>
% </h... |
c0891c075aff470307459537795ec33c837cd2c22022a514f055b6e4418c1b99 | MATLAB | 3,109 | 106 | function fields = computeHarmonicFields(phaseData, mask, params)
%COMPUTEHARMONICFIELDS Unwrap phase and isolate harmonic background fields.
arguments
phaseData
mask
params (1,1) struct
end
requiredFields = ["echoTime", "fieldStrength", "gyromagneticRatio", "voxelSize"];
for fieldName = requiredFields
... |
ea713aa608cea0cef4523d8104bb32aa6091e4afe0c64d6fc18c182bb6519b4f | MATLAB | 3,109 | 116 | % SUB_TREE Indices to child nodes forming a subtree.
% (trees package)
%
% [sub, subtree] = sub_tree (intree, inode, options)
% --------------------------------------------------
%
% Returns the indices of a subtree indicated by starting node inode.
%
% NOTE ! region update for tree output still missing!!!
%
% Input
... |
415ba55c5f23a3b71b0679ad4130caff205e7ce0645adad53a1dfc3cd34fad88 | MATLAB | 3,111 | 58 | function [regParam, projParam] = DefaultProcessingParams(dataSet)
% Registration parameters
regParam.refScan = []; % which scans (in concatenated units) should be used to generate the reference image
regParam.refRun = 1; % which run should be used to generate the reference image (only used if refScan is empty)
regParam... |
7cd58873101bfb82c1a65e040853cdef1d1fd631a03795ac2aab0a3272cfd881 | MATLAB | 3,118 | 114 | function [fn,saveName,all_stRF] = st_plot_stparam_visualized(DT, params, roiList,channel, normVersion,applyExp)
% params=[]; close all;
fn = figure('Renderer', 'painters', 'Position', [0 0 1800 500]);
tms1 = {'\tau_1', '\itw', '\tau_2', '\itn_D_N', '\sigma_D_N'};
tms2 = {'\tau', '\itn'};
% plot info
polar_radius = 12;... |
13386a6483b6e70c2c4d6aad710eda6e45e9b8d059cd29371028a6a88df01300 | MATLAB | 3,119 | 87 | function [mask, mask_np, varargout] = PCAICA_2D_extract(zproj_interp, varargin) % path_interp, , Nx, Ny, Nt trace_raw, trace_hp, Nf
p = inputParser;
%addOptional(p,'crop_amt',0.1); %proportion to crop edges
addOptional(p,'axons',false); %axon flag for pipe.extract.pcaica
addOptional(p,'blur',1); %gaussian blur wid... |
bc3d19458ff4b829af6f9ab7ede9628b293f34d05d4f924053499d35b2e75852 | MATLAB | 3,126 | 92 | function AOexercise
% Monitoring the output
% If you lack an oscilloscope you may physically connect the analog output to
% an analog input and monitor this using the NI MAX test panel. You likely will need
% to select RSE: http://www.ni.com/white-paper/3344/en/
%
%
% Also see:
% Res... |
dd8bd128bd964956a4375898fcf643807a007d07454c95b2381384b913b09d87 | MATLAB | 3,127 | 96 | function varargout = length(val, num, varargin)
%length - Check that the value is of a specific length
%
% length(val, num) checks that val has length num. If it does, nothing
% else happens; if it does not, the function throws an exception from the
% calling function.
%
% length(val, num, 'VarName') includes ... |
e908d32b27636ac52782059d735f77401148e3dde106157d5478ad3c48909e26 | MATLAB | 3,130 | 77 | function [flux, peakLocs, imgSum, linearDensity, rbcSpacingT, maskRBC] = ...
calc_flux(self, radonTrans, theta, idxMaxVarTheta, isDarkStreaks, ...
pixelSize, pixelTime, lineTime, nLines, isOldToolbox, doPlotWindow)
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is... |
3b8b654a7a5c736bf9d60568efab5e36597d0490db77a93c63dbd56eb3c3e40c | MATLAB | 3,133 | 91 | function zapAllCoords_Callback(obj,~,~)
% Cycle the beam over all the stimulus locations in no particular order
%
% zapit.gui.main.controller.zapAllCoords_Callback
%
% Purpose
% Cycle the beam over all the stimulus locations rapidly. This just indicates whether
% the beam is going to the rig... |
ab852eb035807de4b6a385ad4800003929157399574f62895eeb20aada64a51b | MATLAB | 3,133 | 89 | function [f, percCellsPerReg] = LK_PlotCellsPerRegion(cfg)
%
% LK_PlotCellsPerRegion creates a barplot to present the percentage of
% cells per region.
%
% Input is a structure with fields:
% uniqueRegions --> unique regions
% allRegions --> region of each cell
% bCell --> boolean whether cell be... |
ed4f45434bfdba21d485a8cfb52df2da95676f605750050fdabc8ddf63a7ec02 | MATLAB | 3,133 | 105 | function varargout = rawImg(rawImg, varargin)
%rawImg - Check that the value is an appropriate rawImg
%
% rawImg(val) checks that val is a scalar object of the class
% RawImgHelper. If it is, nothing else happens; if it is not, the
% function throws an exception from the calling function.
%
% rawImg(val, reqCh... |
55eea3ca74f20fedf493b40a1e8e4c0bae8a798aa463df7d8ffbd0e5eaf92191 | MATLAB | 3,134 | 83 | function F = root_gALL_omega( x )
% MF & LS equations with constraints for solving synaptic conductances
% and oscillation frequency
%
% Case SYNC = 0, MF solution for 8 synaptic conductances
% Input: 8 unknown conductances g
% x(1) - g(rEA) recurrent AMPAR on E neuron
% x(2) - g(rEG) ... |
0cab8c58913b7d66d2cae3cd735a4f424bb29daf82b9d90a3645d427f6dff3dc | MATLAB | 3,138 | 120 | function motion_correct_plot(sx, sy, dims, refImg)
%motion_correct_plot - Plot a figure illustrating the motion correction
%
% 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/o... |
cc8649e800f00c1760851a1aa9ed56101192da13bca5fa91b0b3b82035c00aaf | MATLAB | 3,141 | 101 | %==========================================================================
% This script plots example ripples.
%
% Lukas Kunz, 2021
%==========================================================================
% start
clear; close all; clc;
addpath(genpath('E:\OpenField\Functions\'));
% fieldtrip
addpath('E:\fieldtri... |
b12541a1a2e7bba795815b52d4814dd056fdf75eb43d8fdcaf69dd91bc864a00 | MATLAB | 3,142 | 80 | function preprocess_param = mv_get_preprocess_param(preprocess, preprocess_param)
% Returns a parameter struct with default parameters for a given
% preprocessing function.
%
%Usage:
% param = mv_get_preprocess_param(preprocess_fun, <param>)
%
%Parameters:
% preprocess - [string] specifying the preprocessing funct... |
db4c047726eb9fb7d364b6f9f8ef46872c82dfc8e5275a3ee6a4920bb347e80e | MATLAB | 3,145 | 99 | %% regCommonality_lsqminnorm
%
% Commonality coefficients for multiple linear regression
%
%% Syntax
%
% explained = regCommonality(y, X)
%
%% Description
%
% Commonality analysis to determine the unique and common explained
% variance of the variables in the multiple linear regression of y and X
%
% * y - dependent v... |
860c59365951169d3ea50e28ca40abfe99de9bb73add0c1fa513efbbdfdb2f90 | MATLAB | 3,151 | 84 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% A 3-layer feed-forward neuronet model, trained by a BWASD %
% algorithm. (version 1.0) %
% %
% Developed in MATLAB R2022a ... |
768826c72412674a4805ab6cb7933d43e3ddd86cb83a776d76a3d47d565bc60d | MATLAB | 3,153 | 98 | classdef (Abstract, Hidden, HandleCompatible) ITraj
%ITraj - Interface for classes that include trajectories
% 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 publ... |
7b1b0590aa889353e4cb1d6fd11cf36d0f5c315f2303d3cb8c8d9e282131a26e | MATLAB | 3,158 | 90 | % Post analysis of the new pipeline
%% Get the distances between each tracked puncta per round
%% Generate an image of puncta centroids across rounds
rnd_idx=5;
filename_in = fullfile(params.registeredImagesDir,sprintf('%s_round%.03i_%s_registered.tif',params.FILE_BASENAME,rnd_idx,'ch00'));
sample_img = load3DTif_... |
f32fff00c4a9ef09a8f34806926b3c7eafa25deb37ad91e724394327fdcf0abc | MATLAB | 3,160 | 99 | function varargout = flip(self, varargin)
%flip - Flip the image data along a given dimension
%
% [OBJfl] = flip(OBJ, DIM) flips a raw image object along the dimension
% DIM. The documentation of the built-in function flip (link below) gives
% more details on how this process works, but the following examples may... |
6acb2dca9b0ffc5d651b6cb472b523dcd1a8b75d7a926d58efa594d5bebd2d8d | MATLAB | 3,165 | 86 | classdef (HandleCompatible) ICalcDiameterLong
%ICalcDiameterLong - Interface for classes that calculate diameter
%
% The ICalcDiameterLong class is an abstract superclass that implements
% (or requires implementation in its subclasses via abstract methods or
% properties) functionality related to calculating dia... |
1f767b9de38354da38fe0995a6876fef824cfcab3c6ccb68627650b984bd2676 | MATLAB | 3,171 | 91 | loadParameters;
if ~params.DO_DOWNSAMPLE
fprintf('Skipping downsample because the parameter file says not necessary\n');
fprintf('[DONE]\n');
return;
end
for rnd_indx = 1:params.NUM_ROUNDS
precheck = true;
for c = 1:params.NUM_CHANNELS
filename_full = fullfile(params.deconvolutionImagesDi... |
5eb6ccb3e4c7b189e05d06f1df4449864ebc378532a71e1dae0a2a611443902e | MATLAB | 3,173 | 107 | % NMF_TREE Export tree to nmf-format, our extended swc format.
% (trees package)
%
% [name path] = nmf_tree (intree, name)
% -------------------------------------
%
% Exports a tree to the nmf-format (HDF5), for now only swc info gets
% exported, a matrix with 7 columns:
% [inode R X Y Z D/2 idpar]
% node index inod... |
9411b9c0c705d7cec6e4e3e739d969fe4c7d22bcb4b3fff67e06879a54db0f76 | MATLAB | 3,176 | 111 | function [DP,DPBSSE,Weight,vA,vB] = CalculateDiscrimination(A,B,sParm)
%% function [DP,DPBSSE,Weight,vA,vB] = CalculateDiscrimination(A,B,sParm)
% Calculate discrimination of A and B
% Inputs:
% A and B must be 3D arrays with [Height,Width,nTrial]
% Height and Width must be the same in A and B, but nTrial can be d... |
c6e28349597c3af1e31d5f12c52025cb0a11c717178f41c4ea69cace11fde134 | MATLAB | 3,181 | 89 | function sigline(xs,lbl,h,yv)
%SIGLINE plots a line of statistical significance on the current axis
% sigline(xs) plots a significance line between the value in the 2D
% vector xs along the x-coordinate.
%
% sigline(xs,lbl) places a text lbl beside the significance line.
%
% sigline(xs,lbl,h) attempts to plo... |
3dcb632eb2efccbfc04311a3b9ca7de2ed9a80997f22aaeeccdaafdaa48f2712 | MATLAB | 3,183 | 92 | function mouseClick_Callback(obj,~,~)
% Allows for adding and deleting points
%
% zapit.gui.stimConfig.controller.mouseClick_Callback
%
% Rob Campbell - SWC 2023
verbose = false;
if verbose
fprintf('mouseClick_Callback executed\n')
end
C = get(obj.hAx, 'CurrentPoint');
... |
df694389d07ec61d9626f891059335910cfabe6ff40468bffc3110ff05745142 | MATLAB | 3,184 | 99 | function calibrateSample_Callback(obj,~,~)
% Initiates the process of calibrating the sample
%
% zapit.gui.main.controller.calibrateSample_Callback
%
% Purpose
% We need a transform that takes us from the camera view to stereotaxic coordinates.
% This method initiates an interactive process ... |
b670bbea71863b29ea6670c2f9cb5c23f54bea2fe13c61a4e78b6ba4443a9850 | MATLAB | 3,209 | 134 | function [fn,saveName] = st_plot_param_scatter(DT, params,roiList,targetVar)
rng('default')
sampleSize = 50;
cc = getmycolors;
% initial filter
df = tableFilter(DT,params);
% give number to ROIs
df = st_tablegiveROInumber(df, roiList);
id = unique(df.subjID);
if strcmp(targetVar,'sigma')
x1 = linspace(0,8... |
23e4545b40111e95ea53b4960d9dea386a89b31b0eadb9a0b0eb27366c16842b | MATLAB | 3,210 | 78 | function anonymousFunctionExample
% Example - how to use anonymous functions and function handles in MATLAB
%
% function anonymousFunctionExample
%
% Purpose
% Demo showing a few simple use-cases for anonymous functions and function handles.
% These crop up quite often if you use functions l... |
2fa6258b94f2d0b49d4722f82bcf6b4a72b449f85afe99f11159871bd3c1b19b | MATLAB | 3,211 | 83 | function msg = returnMalformedKeyReport(fname)
% Report duplicate or non-sequential stimLocations keys in a stim config file
%
% msg = zapit.stimConfig.returnMalformedKeyReport(fname)
%
% Purpose
% Stimulus conditions are stored as fields named stimLocations01, stimLocations02, and
% so on. ... |
162f21c3cd6ccf4ddf71b6fdb3a1dce9e7e8db4ed9d5623d7aa1783efe53a490 | MATLAB | 3,213 | 137 | clear
imSize = [733, 977];
pix2deg = 34.910;
load('a7_2_createAvergedNOTMorphedHeatMapsLoad.mat', 'hmAll')
load a0_0_bhv2trialStrct.mat
%%
%hmAll = zeros(733, 977,nMuscimol, nMonkey, numel(NIm), 'double') from a7_2;
% UMuscimol = [0, 12 (r),9(l) ,4,1];
%iMuscimol =
%1: base
%2: right face patch
%3: ... |
52af4c2adf5ec663db6380d2e8928e331d44cc0d30f129d7939e992e92f20e81 | MATLAB | 3,217 | 90 | function [img_out, cmaps] = combine_img_chs(img)
%combine_img_chs - Combine multichannel images to a truecolour RGB image
%
% IMG_out = combine_img_chs(IMG) combines the MxNxCxP image IMG into a
% MxNx3xP truecolour RGB image in the range [0, 1]. MxN are the
% dimensions of the image(s), C is the number of chann... |
3b3fd9df7d0bc8e1ac08dedee004433317d15175639f5b5ceeac2e93812fab4c | MATLAB | 3,219 | 100 | function synthetic_spikes(comboID)
for rValue = 1:11
main(comboID,rValue);
end
end
function main(comboID,rValue)
addpath('/lustre04/scratch/nbrake/code/simulation_code');
if(nargin<1)
comboID = 13;
end
parpool(40);
mCombos = zeros(11*10/2,2);
count = 1;
for i = 1:1... |
a3483f9bbf5cee1e5b29d26d66a19ee255eb320dcd5f5beb38659cd12ef78d9b | MATLAB | 3,223 | 93 | % sim_spinecho_shaped.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% sim_spinecho_shaped(n,sw,Bfield,linewidth,sys,TE,RF,Tp,grad,pos,ph)
%
% DESCRIPTION:
% This function simulates a localized spin-echo sequence with a shaped
% refocusing pulse. It enables choice of the echo-time as well as the
% choi... |
60743d3c750d83af237d01f92f6e321674de96a8c4e1847f85f0485a497c35da | MATLAB | 3,225 | 116 | % REPAIR_TREE Rectify tree format to complete BCT conformity.
% (trees package)
%
% tree = repair_tree (intree, options)
% ------------------------------------
%
% Repairs a tree. This means removing trifurcations by adding small
% segments, removing 0-length compartments, and sorting the indices to be
% BCT conform... |
19040d9641ae8b040cc9ae4151650a069fc78c8cabbe776ef11991bbfc752e23 | MATLAB | 3,227 | 94 | function hAx = plot_windows(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, either ver... |
404a66e673c1faf72385f7a06535c2a83dfe866a380cab989d3c0835838c2337 | MATLAB | 3,227 | 85 | function zdFF = get_zdFF(reference, signal, smooth_win, remove, lambda, itermax, order, wep, p)
% Calculates z-score dF/F signal based on fiber photometry calcium-idependent
% and calcium dependent signals.
%
% This program is a translation in MATLAB of the Python source code of
% get_zdFF.py
%
% Input
%... |
f653a97954edd03b0fcc7518f5186b31b123139942bd8a7269964c0575e6f178 | MATLAB | 3,229 | 97 | % sim_laser.m
% Robin Simpson and Jamie Near, 2017.
%
% USAGE:
% out = sim_laser(n,sw,Bfield,linewidth,sys,TE)
%
% DESCRIPTION:
% This function simulates an ideal LASER experiment with total echo time
%"TE", and six equally spaced echoes. The function calls the function
% 'sim_Hamiltonian.m' which produces t... |
d31bd9ce2204469a019137bc97a49c2350268882f00296c61559061f18ec97e7 | MATLAB | 3,231 | 87 | function compile(check)
% Compile the mex-files of the TFCE toolbox
% FORMAT compile
% compile(1) raise an error if a mex-file could not be built
%
% The optional check flag is used by the continuous integration, where a failed
% compilation has to abort the build instead of only printing a message.
% ________... |
86ce18e690d9d73990b9ce98bb31d350bbfda0f1712370f43f61d2a0b8869ce9 | MATLAB | 3,234 | 108 |
load('a5_2_averagingHeatMaps21x28_diffSingleImages.mat');
load('a5_2_averagingHeatMaps21x28.mat');
%m = max(mVectorDiff_forEachImage,[],'all');
%mVectorDiff_forEachImage(1,1,:,:,:) = m;
%close all force
t = ({'No Inj.', 'FacePatchRight 10', 'FacePatchLeft 10', 'ControlRight 10', 'ControlLeft 10', 'FacePatchRight 5', '... |
bc0157edba3810584cd672dc64ae92a23f9ed8d6fdd61b056674142141284c48 | MATLAB | 3,244 | 73 | % START_TREES Initialization for TREES toolbox.
% (trees package)
%
% start_trees
% -----------
%
% Creates the global cell array trees and includes the toolbox in the
% path. Newly created trees are appended to this array by default if no
% other output variable is set. Any subsequent function call is applied to
%... |
1a0fb5aab01beee49f9da70a34c0b9dbf2e85feb0d42ce34ba82372317e2ecf8 | MATLAB | 3,245 | 89 | function nestedFunctionExample
% Example - shows how nested functions work in MATLAB
%
% function nestedFunctionExample
%
% Purpose
% You can use sub-functions to avoid repeating the same lines of code
% several times. There are two types of sub-function:
% a) Those "nested" within the m... |
30b6cd057d860629d7864382df68ee725d5a207aceaf3cd75d5cb616564d46b7 | MATLAB | 3,245 | 80 | % Load NY head model
[sa,X] = network_simulation_beluga.getHeadModel;
idcs = sa.cortex2K.in_from_cortex75K;
czIdx = find(strcmp(sa.clab_electrodes,'Cz'));
% Note: different simulation from published figure
load(fullfile(dataFolder,'simulations','example_simulation','simulation','simulation_data.mat'));
% Compute loca... |
1463909672efdb0f2dc62d4492ef763511506d6b8080cfb315beffcff9912a22 | MATLAB | 3,249 | 87 | function stimulus = createTextures(display, stimulus, removeImages);
%stimulus = createTextures(display, stimulus, [removeImages=1]);
%
%Replace images within stimulus (stimulus.image) with textures
%(stimulus.textures).
%
%Stimulus can be a 1xn array of stimuli. It creates the textures
%(like loading in off-screen me... |
cdd48f691c24f5dd301352a27a76722b2282b60b3c42ec93b0420f449845c9ef | MATLAB | 3,249 | 149 | %% plotVisScatter
% genterate scatter plot of lick locations by trial for each world.
% clear; close all; clc
%% Set parameters
day = 20; % training day
buffITI = 2; % amount of ITI included in plot
timeCue = 6; % total cue display... |
d1ebc0718d20bf7a37e34cdcc9cfb3de48e5e0fbddc16f801951427dd84f9ae7 | MATLAB | 3,252 | 83 | %decc_plotFig4
% Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024
% PV 2024
load('DECCdataFig4.mat')
% Figure parameters
fstr = ['SP';'N1';'N2';'De'];
pcolor = [0.85 0.85 0.85];
rcolor = [0.90 0.75 0.90];
lcolor = [0.2 0.2 0.2; 0.0 0.4 0.5; 0.6 0.3 0.0; 0.1 0 0.5];
% Initializing
flim = size(pevt1,2);
rho = ze... |
db008923000eb66dbdfbbbfdb413e88269f8bcf821aca49bad1b2f8c4e83f7fc | MATLAB | 3,252 | 75 | function [job, data] = time_prepare_generic_data(job, data)
% [job, data] = time_prepare_generic_data(job, data)
%
% Add aggregated time-domain data sets per subject across conditions, per
% condition across subjects, and both.
% Creates data sets that are only dependent on the conditions used for
% aggregation; NOT ... |
e9064cbf1c7354a6676699a3e0351f37a54f29a42e6799b2e2ab5007eea38d47 | MATLAB | 3,256 | 111 | % RECON_TREE Reconnect subtrees to new parent nodes.
% (trees package)
%
% tree = recon_tree (intree, ichilds, ipars, options)
% ---------------------------------------------------
%
% Reconnects a set of subtrees, given by points ichilds to new parents
% ipars.
% This function alters the original morphology!
%
% Inp... |
7f1caa4b56227f9e4953e4cf808e39b5512d557f6e2ec512f3e31c8fc26a2223 | MATLAB | 3,258 | 47 | function o = objFun_ICC(effect_vals)
%%% objFun_ICC.m
%%% Omkar N. Athavale, May 2023
%%% Calculate objective function for Step 1 of optimisation procedure (ICC inhibitory component)
%%% INPUTS
%%% effect_vals: 1 x 3 array of k_iAno1, k_iNSCC, p_iICC
%%%
%%% OUTPUTS
%%% o: objective function value
% p_iICC cannot be 0... |
3a3ac41ab8bdeecb7ef10ff84a0697b374dbfe0ddd1ac50abc34b60b37e79ba5 | MATLAB | 3,260 | 122 | function newmap = bluewhitered(m)
%BLUEWHITERED Blue, white, and red color map.
% BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white
% to red colormap, with white corresponding to the CAXIS value closest
% to zero. This colormap is most useful for images and surface plots
% with positiv... |
6a15bc92d7a47f0bf0cef08628a8d3d362e874f5fa412133ddede403e3ba473e | MATLAB | 3,260 | 78 | function [nsyn,synids] = t2n_getSynNum(tree,syn_dens,regions)
% This function calculates the number and location of synapses at a given
% morphology given a synaptic density 'syn_dens'. The output synids can
% then be used to place location-specific synapse mechanisms such as Exp2Syn.
%
% INPUTS
% tree on... |
d3e07743b71e6ebc7025d7782dd970ba5cd9c24cc636ecf6c85bf045a810c482 | MATLAB | 3,263 | 94 | function simulateCombSimpleModel(baseModel, outFilename, fracA, TNM, TNG, TAM, TAG, statUtil, mobUtilN, mobUtilA)
% simulateCombSimpleModel
%
% Generates a combined model from the params supplied and runs a simulation.
% The fluxes of glycolysis, mitochondrial respiration, and both are then extracted
% for both neurons... |
96e2d9005fdf446aabc38943d20292ab77f8ce4d9dffb55b1e3c8bb2b70b1cd6 | MATLAB | 3,272 | 90 | % op_getcoilcombos.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% coilcombos=op_getcoilcombos(file_or_struct,point,mode);
%
% DESCRIPTION:
% This funciton finds the relative coil phases and amplitudes. Coil phases
% are found by determining the phase and amplitude of the pointth point in
% the time domain.
% ... |
f16c0c6e7e5a6f655f53951d74c4e216eb1f2accff9ad5d793b171ecaf9050f4 | MATLAB | 3,272 | 105 | % Classifier unit test
%
% Classifier: kernel_fda
rng(42) %% do not change - might affect the results
%%% Create Gaussian data
nsamples = 80;
nfeatures = 10;
nclasses = 2;
prop = [];
scale = 0.0001;
do_plot = 0;
[X_gauss,clabel_gauss] = simulate_gaussian_data(nsamples, nfeatures, nclasses, prop, scale, do_plot);
... |
bfb8380d10e284cac9bbaba3a924aa5210e95e3f2a9ddb40ae8557241b307213 | MATLAB | 3,274 | 85 | classdef (Abstract) DataDetectSigs < Data
%DataDetectSigs - Superclass for DataDetectSigs classes
%
% The DataDetectSigs class is an abstract superclass that implements (or
% requires implementation in its subclasses via abstract methods or
% properties) all basic functionality related to storing data from signal... |
c1ac0404d53e64a3c0dc68ada5d3ff05714c6a5230bffbd0601ed0a4e28c98a4 | MATLAB | 3,274 | 97 | function [amplitude1,snr1,am_spectrum1,am_spectrum2,snr_spectrum1,snr_spectrum2]=savefor_Figure8(sub)
subnum=sub;
blocknum=12;
condition=2;
frequency=1:1:60;
channum=9;
%Pz¡¢PO5¡¢PO3¡¢POz¡¢PO4¡¢PO6¡¢O1¡¢Oz¡¢O2
% filter--fft
home_path=[pwd,'\temporary data\Downsdata\'];
filename=[home_path,'Downsdata_9_',num2st... |
c57533af17305ad517b8f5b533ca03e8ed0d5a10aab49790448dbe32149defd8 | MATLAB | 3,276 | 119 | function st_cleanDT(rfiles,resultsDir,removeInitial)
% clean synthBOLD into a nice looking table
% also reformat BOLD timecourse into to the mrVista format
% amount of initial signal (blank)
if exist('removeInitial','var')
else
removeInitial = 0;
end
%% gather and Clean BOLD files
AllBOLD = []; AllBOLDpure=[]; G... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.