sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
229db2b57f43acb12c870a325dfefb0ac865628a1f1f9588710d804eaad7fbf0 | MATLAB | 4,253 | 113 | function [amp] = t2n_findFreq(neuron,tree,desNum,options)
% This function finds the current necessary to let each neuron spike a certain
% amount of spikes with an IClamp protocol previously defined in "neuron"
%
% INPUTS
% neuron t2n neuron structure with already defined mechanisms (see documentation)
% tr... |
b1b4a1121d24816eae16bb1f7a804a8b37de42a51dd1a48ae9396eec2faca80a | MATLAB | 4,261 | 125 | clear all
%close all
rng(10)
dataFileName = 'C:\David\Phd2020\ElectordesClassification\imputedDataThetaEmptyColumnsRemovedMouseID.xlsx';
NumTrees = 40
unifyContextClasses = false;
[DataMatrix, Labels,MouseIDs,Days] = GetImputedDataMatrix(dataFileName);
%each column in DataMatrix is a single example
valid = ... |
7da35f117973476fd687f9557aee0cdcdf65a7ad936b7e3f3725150a650f60e0 | MATLAB | 4,266 | 127 | function [loglik] = EEGfMRIPav_cbm_mod08(parameters,subj)
% Standard Q-learning model with delta learning rule and with Go bias,
% Pavlovian response bias, instrumental learning bias, and separate choice
% perseveration parameters for Win and Avoid cues.
% -------------------------------------------------------------... |
c16ba098039dcf70a87e00bdb6304bf96eb47051e9f56ecf1b820841d8da6341 | MATLAB | 4,272 | 121 | function [tau1,tau2,spikes_avg,list_spikes_all]=determine_decay_time_d_nomix...
(traces_raw,ROIs2, d_min, d_max, before, after,doesplot, fs)
% Function to calculate decay time and average spike shape from a moderate SNR range.
% Inputs:
% traces_raw: traces of each neuron. length = (ncells, T)
% ROIs2: neu... |
2e98bffeea803e2dce142145e5bb5bcb991cefe8092d8a027e09543e11ee2c29 | MATLAB | 4,279 | 105 | classdef (Abstract) DataVelocityStreaks < DataVelocity
%DataVelocityStreaks - Abstract superclass for DataVelocityStreaks classes
%
% The DataVelocityStreaks class is an abstract superclass that implements
% (or requires implementation in its subclasses via abstract methods or
% properties) all basic functionalit... |
841d2cacb738c210c0f2b26e7e20ea19230cf220a8b095ae0e10b87c63c7cfab | MATLAB | 4,293 | 114 | function output = regress_baseline(input, x, startIdx, stopIdx, corMode)
% output = regress_baseline(input, x, startIdx, stopIdx, corMode)
%
% Remove baseline by performing regression over trials.
%
% INPUTSs:
% input = matrix of numerics of n-dimensional format.
% First dimension is trials.
% Arbitary nu... |
c41045e73244c6354c2f1410d79dfceb72335cb54d81456c2d3dd50ad24edd76 | MATLAB | 4,309 | 101 | function EEGfMRIPav_extract_rawdata()
% EEGfMRIPav_extract_rawdata()
%
% Reads the .mat raw data files, extracts relevant fields, saves as .csv
% per subject per session.
%
% Mind setting root directory and target directory for saving.
%
% INPUT:
% none.
%
% Output:
% Saves .csv files.
%
% EEG/fMRI STUDY, DONDERS IN... |
c93f14f4754bc6aa8e64b16350c608c7c7f3dc4a367d7b426f0c73e13ba64f68 | MATLAB | 4,311 | 124 | classdef Test_CalcDiameterLong_params < matlab.unittest.TestCase
%Test_CalcDiameterLong_params Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (TestParameter)
classCDL = utils.find_subc... |
b093ab9a2fb9af356ce7479c0545ba0e4c67f0e5612cc3023e6e950c8c8c775e | MATLAB | 4,322 | 95 | function [GIDs,neuron,mindelay] = t2n_getGIDs(neuron,tree,thesetrees)
% This function prepares the neuron structure to be used for the parallel
% NEURON environment. Also it returns the global IDs, which are necessary
% for the parallel environment.
%
% INPUTS
% neuron t2n neuron structure with already defi... |
756253e3d0ebf6b9b8c73deae401be03e1b809888361c09f485206205968901b | MATLAB | 4,323 | 105 | function nifti = io_CSIload_nifti2(filename)
arguments
filename (1, :) char {mustBeFile}
end
matlabError = [];
nifti = struct();
try
%open the file
fileID = fopen(filename, 'r');
%sizeof_hdr: Needs to be 540
header = fread(fileID, 540, '*int8')';
ni... |
e7cb7e219cdcadde311b9705803aa79f5f161ee74966216d7707a067aa53aefe | MATLAB | 4,323 | 99 | function drawFixation(d, colIndex)
%
% drawFixation(display, [colIndex=1])
%
% Draws the fixation point specified in the display struct.
%
% HISTORY:
% 2005.02.23 RFD: wrote it.
% 2005.06.29 SOD: added colIndex for fixation dot task
% added largeCrosses options
% 2008.05.11 JW: added 'dot and 'none' op... |
3fab9c8e6cbd51d7945aa0600ee55ebd252cb05c35a1a237ea8ad2f8706c4319 | MATLAB | 4,328 | 115 | classdef waveform_tests < matlab.unittest.TestCase
% These tests ensure that future changes to the code will not alter the waveforms
%
% NOTE: you will need to update chanSamples.mat if you alter how the waveforms are
% generated by Zapit. e.g.
%
% 1. >> start_zapit('simulated',true) % Optionall... |
f33d12594539a5a40c8238fb8897a37f8ed33ceb7cc4df7371178323d9a71023 | MATLAB | 4,328 | 96 | function [trainedClassifier, validationAccuracy] = FTR(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% generated code to automate t... |
d91c8579189be1915e3bf23e065de1f6d7d67a366e13a673811cf0345063062b | MATLAB | 4,329 | 132 | % CLEAN_TREE Cleans a tree from nodes inside of main branches.
% (trees package)
%
% tree = clean_tree (intree, radius, options)
% -------------------------------------------
%
% Cleans tree of improbable nodes (after e.g. automated reconstruction or
% artificial generation of a tree structure). Termination points in... |
c17d39263c5b484fca43f8f8254c3d5675d7669e34e563288b09051fb01b570a | MATLAB | 4,333 | 124 | function mask = choose_mask(self, imgType, varargin)
%choose_mask - Protected class method to choose an individual mask
% 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 Lice... |
d8f753788364131bc0e54cbf90d2763f2ccaabb1c2019593ce2439e6176f0909 | MATLAB | 4,334 | 136 | function [out] = EEGfMRIPav_cbm_mod08_osap(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian response bias and Pavlovian learning bias and separate
% perseveration parameters for Win and Avoid cues.
% --------------------------------------------------------------------... |
098b6dc3090ddeaaccaeea9cdea9421e616731268275285aba23b17235db5177 | MATLAB | 4,345 | 248 | %make the excel data (20230724-RBR-new) into matlab file: RBR=[];
A=RBR(:,31:48);
A(A==0)=nan;
RBR(:,31:48)=A;
save('RBR.mat','RBR')
m=nanmean(RBR,1);
s=nansem(RBR,1);
figure
errorbar([1:1:43],m(1:43),s(1:43),'k')
hold on
plot([11:1:20],m(11:20),'b.','MarkerSize',15);
saveas(gcf,'RBR.fig');
%% same thin... |
3f124a3991ceb846517ef3f5f5c04827b552c37aa5d3da6ce07b4adeac8adbad | MATLAB | 4,346 | 131 | %% CalibrationPixelSize
% Store pixel size calibration
%% Usage
% OBJ = CalibrationPixelSize(ZOOM, PXSIZE, IMGSIZE, OBJECTIVE, DATE,
% NAME, PERSON, FUNRAW)
%% Arguments
% * |ZOOM| is a vector of zoom values at which the pixel size is known.
% * |PXSIZE| is a vector of pixel sizes at the given zoom values.
% ... |
3a545bbc53bd30076da4da39fbd80a56e90a25206b836a8dd061f29fc8d10d99 | MATLAB | 4,350 | 127 |
%Load the set of all pixels of all puncta across all rounds from the
filename_pixels = sprintf(fullfile(params.punctaSubvolumeDir,sprintf('%s_punctavoxels.mat',params.FILE_BASENAME)));
load(filename_pixels)
fprintf('Loaded.\n');
%This is the size of the cropped images, corresponding to ~15um pre-ExM
filename_punct... |
344c7ead2bf2286ed62d28bdc19cc3ed66eef08a16cf22ff0f46cdf1bcd92b0c | MATLAB | 4,352 | 158 | function out = plot_y_yfit(yval, yfit, varargin)
% out = plot_y_yfit(yval, yfit, varargin)
%
% case {'xlim'}
% xlim = varargin{i+1};
% case {'ylim'}
% ylim = varargin{i+1};
position = [1 747 218 208];
prop = 0.2;
if iscell(yval)
if ~any(isrow(yval)-isrow(yval{1}))
xlim = [min(min(cell2mat(y... |
66e1268a31c8cde6e723b8b557972e7118bf2e5dc9f93b855c42a2b979b1a7a5 | MATLAB | 4,353 | 112 | %% Raster Peristimulus Time Histogram (PSTH) Example
%
% <html>
% Import snippet and epoc data into Matlab using TDTbin2mat <br>
% Generate peristimulus raster and histogram plots over all trials <br>
% Good for stim-response experiments, such as optogenetic or electrical
% stimulation
% </html>
%% Housekeepi... |
b23ae602cc95c5fcc98afda3cc30a27db678fa37f2a5da845677781d31e2b3f1 | MATLAB | 4,356 | 112 | %% Raster Peristimulus Time Histogram (PSTH) Example
%
% <html>
% Import snippet and epoc data into Matlab using TDTbin2mat <br>
% Generate peristimulus raster and histogram plots over all trials <br>
% Good for stim-response experiments, such as optogenetic or electrical
% stimulation
% </html>
%% Housekeepi... |
ed852fa52cb0ec707ff479f15eacc0df0985d213937cd93c19a7b1d4b0cdfc1a | MATLAB | 4,356 | 132 | %%% optimisation_results.m
%%% Omkar N. Athavale, May 2023
%%% Plots the results of optimisation procedures and prints summary statistics
%%% in combination using saved data files
% ---INPUTS---
% data inputs
smc_data_path = '../data/optim_SMC_data';
icc_data_path = '../data/optim_ICC_data';
% plot options
histogram_... |
38fc126de37094bfeeee44b35660889f7688f90d2856dff5c22d0282cb4a29af | MATLAB | 4,358 | 175 | %CONVEXITY_TREE Calculates convexity of a tree.
% (trees package)
%
% [c] = convexity_tree(intree,options)
% --------------------------------------
%
% returns the convexity of a tree structure. Convexity is defined as the
% proportion of direct paths between termination points of a tree that lie
% entirely within the ... |
7d25ee04f3b5ecea7d05058a994ce218e06c6eb603fca8940a51a4504b5851c0 | MATLAB | 4,359 | 133 | function [loglik] = EEGfMRIPav_cbm_mod09(parameters,subj)
% Standard Q-learning model with delta learning rule and with Go bias,
% Pavlovian response bias, instrumental learning bias, neutral outcome
% reinterpretation parameter, perseveration parameter.
% Only neutral outcomes can be reinterpreted.
%% Retrieve param... |
85330b07bef71f629619376c9bf0d635b5f5c552714abf6134ef700ac705deb7 | MATLAB | 4,360 | 170 | function varargout = progbarpar(varargin)
%progbarpar - Helper function to create/update a parallel progress bar
%
% 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
%... |
848ec953940f7e1603265fa3f5b20f056e45b76ed1f350f29b0e8dfb3620e068 | MATLAB | 4,369 | 116 | [vfilename,vpathname] = uigetfile({'*.mat'},'Select table performance file')
cd(vpathname);
vfile = fullfile(vpathname,vfilename)
load(vfile);
dataset_path = '/Users/gustavo/git/ahof_vocalmat/vocalmat_classifier/training/.dataset/testset';
imds = imageDatastore([dataset_path], 'IncludeSubfolders', tru... |
bf6c0ffc9f4928b43c6d86b054c58efd3d798ebdd4adc9a4cf52c47838329f81 | MATLAB | 4,370 | 85 | function [segmet_start_time_Array segmet_end_time_Array activity_per_segment_Array]=...
TimeSegmentation_Ver1(TimeVec,NumOfStates,state_per_frame,all_trials_activity_smoothed_mat,gap_threshold_vec,long_segmet_treshold_vec)
% TimeVec
% state_per_frame
% NumOfStates
%maybe to make those external(struct as input) +... |
22e113382df3810e52d945f848e17293792e1980296a544668d3856e232eb4b8 | MATLAB | 4,381 | 98 | function [trainedClassifier, validationAccuracy] = FKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% generated code to automate ... |
a20aa31b9f4a1ae14623a7cc78c3cdb45732a26b6cc6619c165804bfa4b7324c | MATLAB | 4,388 | 98 | function [trainedClassifier, validationAccuracy] = LSVM(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% generated code to automate ... |
19b9f656c97e1ced71bf0958151b091ff18e0ffa516f3072a453917b4cd46b53 | MATLAB | 4,392 | 116 | function connectClockedDO(obj, varargin)
% Set up a clocked DO task that will be triggered and synced to the AO task
%
% function zapit.DAQ.dotNETwrapper.connectClockedDO
%
% Purpose
% Create clocked DO task that will deliver digital waveforms for things like
% the LED masking light. The clo... |
1cb5f9825a75cda13f108722ca7ece876312d2e2fc6e18fc0b06ae43f7445f42 | MATLAB | 4,396 | 160 | function varargout = run_tests(varargin)
% Work out if we're doing any filtering
[doFilter, fFilter, idxStart] = check_mode(varargin);
% Set up the path
oldpath = addpath(pwd, fullfile(pwd, 'tests', 'res'));
% Do this once, to pre-fill the persistant variable
utils.find_subclasses('CalcDetectSigs');
isOld = verLess... |
99b1a042ccda746d61b137cdad6a9b4908362cbd83d283faf65435e11ce6c3df | MATLAB | 4,406 | 188 | % Reconstruction using spatially varying PSFs
% PSFs after registeration and FFT are used here
% Spatially varing weights are used here
% Reconstruction for a single plane
%%
reload = 0; % Set to 1 if continue previous iterations
if reload ==0
clear;
useGPU = 1;
if useGPU
gpuDevic... |
20f052e1f819991d996ef59bba05349a858e706bde53821ad2974f2b76329876 | MATLAB | 4,412 | 79 | function [FiberPhotometry1_SampleRate,FiberPhotometryDataNormalized,FiberPhotometryPeaksInSec]...
=Analyze_FiberPhotometry_data_27_1_2020(filenameFiberPhotometryData,StartTriggerTimeInSec,FiberPhotometryAmpThreshold,AllParameters)
FiberPhotometry1_SampleRate=[];
FiberPhotometry2_SampleRate... |
3f4bbff844d969aefc129d3ba02cbed85a67b95ae926bb05efe1090cc409b160 | MATLAB | 4,413 | 180 |
clear
close all force
load a3_3_1_countingTime_everyTrial.mat
UM = [ 12,9 ;13,10 ;4,1 ;5,2 ;14,11 ;15,16 ;6,3 ;7,17 ]+1;
UMS = {'ML_10_M','ML_10_S','Co_10_M','Co_10_S','ML_5_M','ML_5_S','Co_5_M','Co_5_S'};
UM = [ 12,9 ;4,1 ;14,11 ;6,3 ... |
afecd1f4adee04f796a80c7626b8063c0a86fc55478ef8cdc862e0a2c75ea1bd | MATLAB | 4,426 | 115 | function cf = train_multiclass_lda(param,X,clabel)
% Trains a multi-class linear discriminant analysis (LDA) classifier with
% shrinkage regularization of the within-class scatter matrix. Multi-class
% LDA can be seen as a prototype classifier: First, the data is mapped
% onto a (C-1)-dimensional discriminative subspa... |
3b48b8d69057c05a6f8ed170aca96581db94fa34a2c9594ddf607146ff74bf3f | MATLAB | 4,433 | 117 | %% 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... |
80a81b8f2bdbd3ffcbd63b2f2ddc6a9cf5a1d34bf03af4f18aafbdc6fc2469ac | MATLAB | 4,434 | 158 | function [param,stat,chance_point]=sigm_fit_color(x,y,fixed_params,initial_params,plot_flag,col)
% Optimization of parameters of the sigmoid function
%
% Syntax:
% [param]=sigm_fit(x,y)
%
% that is the same that
% [param]=sigm_fit(x,y,[],[],[]) % no fixed_params, automatic initial_params
%
... |
6417dccc26a31462cdeee7c2c9ee9fe6e69f680b66bc4e44b794ebc50bf18d89 | MATLAB | 4,438 | 139 | %% spatiotemporal pRF Demo
% 1) download toolboxes
% 2) set variables and create JSON files
% 3) create Synthetic timecourses
% 4) Solve spatiotemporal PRF models
% 5) Plot results
%%
% download required toolboxes
download_toolboxes('toolbox_urls.txt', 'code/toolbox')
%% generate synthBOLD
clear; clc;
simDir = pwd; %... |
a7f3b8cacd7d538439b7a74a9174b951ec1a1400481410bf4f1eb046d6a236a4 | MATLAB | 4,444 | 181 | %% This script runs percentage of labeling
GFP = [80.23255814 80.859375 24.03100775 29.80769231;48.23529412 68.7150838 15.29411765 30];
ChR2 = [60.6741573 35.7615894 3.370786517 1.492537313;46.42857143 36.79245283 5.952380952 3.521126761];
Reelin_GFP = nanmean(GFP(:,1));
Reelin_ChR2 = nanmean(ChR2(:,1));
Cal_GFP... |
212eea6ca64c9412ba2fcf2925a8870c740c87bd542ea6c7939210e408e11f15 | MATLAB | 4,453 | 117 | close all;
clear all;
clc;
addpath(genpath(pwd))
%% Define search path.
rootDir = pwd;
dataFolder = fullfile(rootDir, 'data');
dataFile = 'Fig-Tm9-processedTableWithBackgroundOnOff.mat';
dataPath = fullfile(dataFolder, dataFile);
load(dataPath, 'onoffTable');
%%
figDir = fullfile(rootDir, 'figures');
... |
7291fc6b905597b022fa78b54336adaa32a80f0620336d8b98677b0012a891ab | MATLAB | 4,456 | 143 | function [out] = EEGfMRIPav_cbm_mod09_osap(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian response bias and Pavlovian learning bias and single
% perseveration parameter and neutral outcomes reinterpretation parameter.
% ----------------------------------------------... |
a8064038a78ecc0496675909152698261eca9bbadf9e4739d41375f0c7fac6c7 | MATLAB | 4,466 | 133 | function EEGfMRIPav_OutcomeLocked_2_ICA(rootDir, subVec)
% EEGfMRIPav_OutcomeLocked_2_ICA(rootDir, subVec)
%
% Perform ICA on data, save components.
%
% INPUTS:
% rootDir = string, root directory of project
% subVec = vector of integers, numbers of subjects to process
%
% OUTPUTS:
% saves compon... |
5ef109d86204a0397aa84c43f01ed95545e2339afceeeafd4482fc434ada5388 | MATLAB | 4,467 | 112 | function output = taft_prune(input)
% output = taft_prune(input)
%
% Prune away clusters that have "bridges" of only 1 voxel.
%
% INPUTS:
% input = 2D matrix with 1 for cluster above threshold, otherwise 0.
% OUTPUTS:
% output = same matrix, but bridges pruned, so now more smaller
% clusters.
%
% EEG/fMRI STU... |
e70e660812540ace6b1e8f3efd45572d22e9104d2dea3c8c6231d9c504c4298f | MATLAB | 4,472 | 173 | function make_blanking_fig
% function make_blanking_fig
%
% Purpose
% Make the figure showing how Zapit performs blanking. In other words, this is how Zapit
% coordinates motion of the scanners with blanking the beam. The beam is off when the
% scanners are moving. A figure file called "blanking_figure" is saved to dis... |
6664e2208102100783e928f58058e1bd8c0ae16d6f6e7f23fd3ac14790e56d78 | MATLAB | 4,476 | 121 | %% Metadata
% Store image metadata
%% Usage
% OBJ = Metadata(IMGSIZE, ACQ, CHS, CAL)
%% Arguments
% * |IMGSIZE| is a vector of the dimensions of the raw image data.
% * |ACQ| is a scalar structure containing information about the image
% acquisition (e.g. line time, zoom factor etc).
% * |CHS| is a scalar structure... |
8c8193a2418aeca763e5ff62ae1bd1e1268bd6473155e1f3213e88b06e09edd6 | MATLAB | 4,476 | 127 | function varargout = hardwareContinuousVoltageBasic(devID)
% Example showing basic hardware-timed analog output with continuous samples using DAQmx via .NET
%
% function nidaqmx.AO.hardwareContinuousVoltageBasic(devID)
%
% Purpose
% Shows how to do hardware-timed analog output using the DAQmx .N... |
39a0f5d8b2b37dce4636edde0e79d40285302572edf0bdb1e62059daf5056999 | MATLAB | 4,482 | 167 | function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent)
% function H=shadedErrorBar(x,y,errBar,lineProps,transparent)
%
% Purpose
% Makes a 2-d line plot with a pretty shaded error bar made
% using patch. Error bar color is chosen automatically.
%
% Inputs
% x - vector of x values [optional, can be left em... |
4f835137c19c45d343a5face36339d9c8d3dc9444c0e74c310a2fea932a49a92 | MATLAB | 4,485 | 154 | %% cpsd_to_var
%
% Spectral factorisation: calculate VAR parameters from cross-power spectral density
%
% <matlab:open('cpsd_to_var.m') code>
%
%% Syntax
%
% [H,SIG,iters] = cpsd_to_var(S,G0,maxiters,numtol)
%
%% Arguments
%
% See also <mvgchelp.html#4 Common variable names and data structures>.
%
% _... |
07f59c21c8d7355386704f0655c8d9b37d5a1e41bd110c5181542cefe7209d14 | MATLAB | 4,494 | 76 | function [Piezo1LargeMovementTimeInSec,Piezo2LargeMovementTimeInSec,Piezo1DataIn2000HzNormalized,Piezo2DataIn2000HzNormalized]...
=AnalyzePiezoSensorsData_6_6_2017(Piezo1DataIn2000Hz,Piezo2DataIn2000Hz,StartTriggerTimeInSec,LargeMovementsLowThresholdInPercent)
%%%%%%%%% Removing baseling, which are voltage... |
3bc3a5287fd3848974f5b64b28ea1caf06d8b9e7f80ee7a011b7d453a707b481 | MATLAB | 4,495 | 116 | function t2n_currSteps(neuron,tree,targetfolder_data,ostruct)
% This function performs one or multiple current steps in the cells given
% by "tree" and "neuron" and saves the results in a mat file named
% according to neuron.experiment.
%
% INPUTS
% neuron t2n neuron structure with already defined mechanisms... |
05472e690e1f751a156163e393666dd74075af54d5ae7b23900edcaa6d323f09 | MATLAB | 4,498 | 114 | %% check optotune limits
c = 0;
for x = xPresent
c = c + 1;
line( c*[1,1], runInfo{x}(1).otparam(1:2), 'color', 'k' ); hold on;
%plot( c, runInfo{x}(1).otparam(1:2) );
plot( c, runInfo{x}(1).otparam(1:2), '.' );
end
xlim([0,c+1]);
set(gca, 'Xtick',1:c, 'XtickLabel',{expt(xPresent).name}, 'Tick... |
8f03cb88b4ece5b141a54c952e42fd80a6c7eec388d82bc652b2755b4a76a987 | MATLAB | 4,501 | 169 | function [par,fpath] = readprocpar2(fpath, ext)
% READPROCPAR reads in parameter used in FID acquisition
%
% PAR = READPROCPAR(FPATH) reads the parameters in the the
% procpar file in the FID directory FPATH
%
% see also WRITEPROCPAR, READFID, WRITEFID
% Written by L Martyn Klassen
% Copyright 2009 Robarts Resea... |
fe37ea242dd2dea56532c2a6956b332b3fa61c81cfb54ad57af3d76d84b599f9 | MATLAB | 4,513 | 135 | % op_alignAverages_robust.m
% Jamie Near, McGill University 2014.
% Mark Mikkelsen, Johns Hopkins University 2020.
%
% USAGE:
% [out,fs,phs]=op_alignAverages_robust(in);
%
% DESCRIPTION:
% Perform robust spectral registration in the time domain to correct
% frequency and phase drifts. As described in Mikkelsen et al.
%... |
724e55c15adc67521721c5cd300bb3e410095f05d48c026681820c3b8bb75ff5 | MATLAB | 4,519 | 133 | function out = convertSharedReward2BIDSevents(subj)
% This function converts the raw behavioral output from psychopy into
% the BIDS *_events.tsv file format. It also collects summary information
% about the subject's data in the "out" variable.
% set up paths
scriptname = matlab.desktop.editor.getActiveFilename;
[co... |
475598bdda934d0837568096de06c8d20ca16a78de8a9d4f01c54f81d7ca60fe | MATLAB | 4,532 | 146 | function [out] = EEGfMRIPav_cbm_mod06_modSim(parameters, subj)
% Standard Q-learning model with delta learning rule and Go bias and
% Pavlovian bias and separate learning rate for salient Go responses
% (action priming model).
% ----------------------------------------------------------------------- %
%% Retrieve par... |
74c4fac3edada429c69ff392e7daf1a8fae617a48c2e2ff6aa507b283dd5c373 | MATLAB | 4,534 | 159 | function [fn,saveName,lme_temporal] = st_plot_temporal_ecc(DT, params,roiList,targetModel)
%%
params =[];
% fn = figure('Renderer', 'painters', 'Position', [100 100 500 500]);
% modelNumber = targetModel;
params.modelNumber = targetModel;
% initial filter
df = tableFilter(DT,params);
% give number to ROIs
df = st_ta... |
ee0e4c8b30200107602a5288a0604c98148ce6b5772cf0421a8e0a563231974b | MATLAB | 4,537 | 193 | %%
% clear; close all; clc
codeT = 'Fx';
d = dir(['data' codeT '_*']);
nFile = length(d);
PR = [0.78,0.977];
globOn = 1;
nType = 3;
nSubsets = 1000;
%%
dists = cell(nFile,nType);
for f = 1:nFile
load(d(f).name)
if f==1 && strcmp(pwd,'D:\Novelty_Analysis\clusterMan\good')
... |
3ac9f7492d624dc2e58e27ac93719910873bc451d8d2e6dacebd6d373f91fd77 | MATLAB | 4,538 | 163 | function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent)
% function H=shadedErrorBar(x,y,errBar,lineProps,transparent)
%
% Purpose
% Makes a 2-d line plot with a pretty shaded error bar made
% using patch. Error bar color is chosen automatically.
%
% Inputs
% x - vector of x values [optional, can be... |
5103012e8ea4c4f047bd953797492a95a6efe72424b0e72f4ac544e9ba2d2905 | MATLAB | 4,545 | 109 |
% the discovery dataset is available at https://figshare.com/articles/dataset/Subjective_fear_dataset/13271102
% load('Anxiety_Lucy_noshock_novisual_n44.mat')
% load('fear_datasets_idx.mat')
nsub = 44;
nrepeat = 10; % for 10X10 cross-validation
nlevel = 5; % 5 ratings
predicted_ratings = zeros(length(rating.Y... |
1b6aa5bf049304bf4ef8f9720c6594dfd62ae86567ca2585d9d942d169feab0d | MATLAB | 4,546 | 107 | % __________________________________________________________________
% TS extraction for resting state fmri
% ------------------------------------------------------------------
function rest_ts_extraction(subject_index,ConfigFile)
% Show the system information and write log files
warning('off', 'MATLAB:FINITE:obsolet... |
43f71be5bd9835cec118d64aab711f54cce2d4d667191c3c2766d86bdaec200a | MATLAB | 4,547 | 126 |
clear
clc
yvar = 'age'; % leave this alone
testStr = 'ICBM'; % ICBM was always used as the validation set
% load train data
load TrainInfo_extra_new.mat
% filter data by the available dependent variable
file = '/home/atbaria/Julie/Text_Files/data_combined_update_pibindex.xlsx';
id = TrainInfo.FeatureMatInfo.id;
s... |
8f403171556c17563706c3dbdeb280889e731a152679dae353d08109ec5e750b | MATLAB | 4,547 | 133 | function maskCombined = calc_combined_mask(self, varargin)
%calc_combined_mask - Calculate a combined mask from a CellScan array
%
% MASK = calc_combined_mask(OBJ) returns a ROI mask where a pixel is true
% in the combined mask MASK if it is true in at least one of the ROI
% masks contained in the CellScan array ... |
17a9d5326259150ac8bafc67e93ecaf6c2b6e311adc332c16dc604240d430039 | MATLAB | 4,549 | 162 | function varargout = plot_trajs(varargin)
%plot_trajs - Helper function to plot trajectories
%
% 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 the term... |
2964fbe69fe4156fc984b3e6f7fb169c473229e298935bc85cfeb36bd3bad7ce | MATLAB | 4,550 | 153 | clear; clc;
stPRFdir = pwd; % set path...
addpath(genpath('./code'))
download_toolboxes('toolbox_urls.txt', 'code/toolbox')
targetFile = getAllFiles2('./results/paperfMRI/tables','*.mat',1);
plotDir = fullfile('./results/paperfMRI/figures');
if ~isfolder(plotDir); mkdir(plotDir); end
% select ROIs ===============... |
3639f6d4989dff5afc625ed5d30cdf130c694677c8a6de4bca027a0bc0c81c73 | MATLAB | 4,553 | 111 | function nifti = io_CSIwrite_nifti2(MRSIStruct, filename)
arguments
MRSIStruct (1, 1) struct
filename (1, :) char
end
matlabError = [];
nifti = struct();
try
%open the file
fileID = fopen(filename, 'w');
%sizeof_hdr: Needs to be 540
nifti = writeHea... |
8a97c9621dd60ca91e87e1a5911056d6f93324f9239e847ea2510b070387067b | MATLAB | 4,561 | 156 | % op_alignMPSubspecs.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% [out,fs,phs]=op_alignMPSubspecs(in,mode,initPars,ppmWeights);
%
% DESCRIPTION:
% Apply spectral registration to align MEGA-PRESS subspectra prior to
% subtraction. By default this function is designed to minimize subtraction artefacts
% accr... |
78a0015de5da26e86100bdac0e56aab5993561c7a6bf594a0ec3612a38afb3c0 | MATLAB | 4,562 | 86 | function interRunShift = ConcatenateSinglePlane(expt, runInfo, catInfo, refRun, commonEdge)
catExt = '.sbxcat'; %'.sbxz'; %
sbxCatPath = [expt.dir, expt.name, catExt]; % [expt.dir, expt.name,'_redo', catExt];
if ~exist(sbxCatPath,'file')
if expt.Nruns > 1
sbxPath = cell(1,expt.Nruns); projPath = c... |
9cf36d5e5f8262a6e716a6980a80a4330b2e51faa7e15bb2c1bd97506e97dc92 | MATLAB | 4,567 | 104 | % the pattern separation toolbox: analyse spike train ensembles
% Copyright (C) 2022 Alexander D Bird
function [RR_obj] = RR_function(input,output,code,num_params,options)
%RR_FUNCTION Calculates the redundancy of the input and output ensembles
if nargin<3 || isempty(code)
code={'spatial','spatial'};
elsei... |
9563b3c3ed77918efa2b32991649849bbceac01be6be5c9283d368df6b778561 | MATLAB | 4,573 | 128 | % FigureS15.m
% Plots for Supplementary Figure S15.
%
% EEG/fMRI STUDY, DONDERS INSTITUTE, NIJMEGEN.
% J. Algermissen, 2018-2023.
% Should work in Matlab 2018b.
% we are here:
% cd /project/3017042.02/Analyses/FiguresOutcomeLocked
% clear all; close all; clc
% Set root directory:
cd(fileparts(which('figures_set_roo... |
b5a44f94b99934a0c2b067f439c1ffddf4f1d2968dfd927d554babf7be10a260 | MATLAB | 4,582 | 173 | %% S1 Fig
% Jiaxin Gao
% Zhejiang University
% email: jiaxin_gao@zju.edu.cn
%% synaptic depression (David 2009)
%% 0.125-s echoic speech
% The Code for S1 Fig A(left)
clear
clc
addpath '.\tools'
fs = 100;
load('.\FigS1_data.mat')
phy_coh_sum_125 = FigS1_Data.A.phy_coh_sum_125;
phy_coh_sum_250 = Fig... |
0feb59a75e00191f8076411123446d19b49851cda3569218e53c07456457c953 | MATLAB | 4,583 | 142 | function tests(obj)
% (c) Corey Baron 2020
N0 = 32;
if gpuDeviceCount>0
useGPU = 1;
else
useGPU = 0;
end
for nD = 1:3
% Check adjoint for basic cases
imN = repmat(N0, 1, nD);
imN = imN + (0:4:4*(nD-1)); % Make each dim have different size
kloc = (-imN(1)/2:imN(1)/2-1)'/imN(1); % Use cartesian ... |
4a20512851b193544c313372fb378196f588ba314550766a28e3cece3629b8b2 | MATLAB | 4,585 | 124 | % sim_press_shaped.m
% Robin Simpson and Jamie Near, 2014.
%
% USAGE:
% out = sim_press_shaped(n,sw,Bfield,linewidth,sys,tau1,tau2,RF,tp,dx,dy,Gx,Gy,flipAngle,centreFreq)
%
% DESCRIPTION:
% This function simulates the PRESS experiment. The excitation is
% simulated as an instantaneous rotation, and the refocusing pu... |
15b770b708e6f86dd5f289ed9bd83a4ef5d97b2f3c7e62fbbae4dae9b927a9a5 | MATLAB | 4,597 | 111 | function keyPress = displayInstructions(display,params,allowKeys)
% keyPress = displayInstructions(display,params,allowKeys)
%
% Purpose
% Take a structure filled with text you'd like to present as instructions
% to a subject as well as parameters about each bit of text, and render it.
% Afterwards, wait for a re... |
182dd8f03bebb7cff86e39ebd3d6ef91f8ff5c4a821928740e538a50ef83a1d6 | MATLAB | 4,599 | 144 | % GDENS_TREE Density matrix of a tree.
% (trees package)
%
% [M, dX, dY, dZ, HP] = gdens_tree (intree, sr, ipart, options)
% -------------------------------------------------------------
%
% Calculates a density matrix of nodes in the tree intree. Uses isosurface
% to display the resulting gradient and increases opac... |
1c5f33f2459ba299f90bdaac17c42cfcb1dcd5b69f966f05fcfa420e6198040f | MATLAB | 4,602 | 118 | function [clabel, dval, prob] = test_naive_bayes(cf,X)
% Applies a Naive Bayes classifier to test data.
%
% Usage:
% clabel = test_naive_bayes(cf, X)
%
%Parameters:
% cf - classifier. See train_naive_bayes
% X - [samples x features] matrix of test data or
% [samples x ... x .... |
28cf0c18cf6498b6675488328f6df1ca6510f3662f4874aee4213e2b6267011e | MATLAB | 4,613 | 156 | % This script provides a walk through of the analysis pipeline for the paper.
% All functions/scripts should be run within the
% top level working directory. After making sure the required datasets are present (see README),
% run these two commands before running any of the scripts/functions below
% to be sure everyt... |
00a1e2804296d9c42053c8a3926c804486049636676df07c61f08cbc38f21b5e | MATLAB | 4,615 | 145 | function varargout = start_zapit(varargin)
% Creates a instance of the zapit pointer class and places it in the base workspace as hZP
%
% function start_zapit(varargin)
%
% Purpose
% Zapit startup function. Starts software if it is not already started.
%
%
% Optional Input args (para... |
297eb51ccc2a9ba33c9a26a24bb9c0af13124e8c393f67e3545ad8191b834319 | MATLAB | 4,618 | 167 | % mv_classify_across_time unit test
%
rng(42)
tol = 10e-10;
mf = mfilename;
%% Create a dataset where classes can be perfectly discriminated for only some time points [two-class]
%
nsamples = 100;
ntime = 300;
nfeatures = 10;
nclasses = 2;
prop = [];
scale = 0.0001;
do_plot = 0;
can_discriminate = 50:100;
% Genera... |
25b1ffbbe9c4bf12d9f1a76fee6c2ed185f34935c8ca19ff78a8979714b4b9ab | MATLAB | 4,621 | 149 | function inc_version(mode)
%inc_version - Increment the current version of CHIPS
%
% inc_version(MODE) increments the current version of CHIPS that is
% returned by the function CHIPS_version. The input MODE must be a
% scalar integer from 1 to 4, where the values have the following effect:
%
% MODE | EFFE... |
bf983bf154341de94ecf062da4401f156ed30975164b7516b89d34b33ace78b2 | MATLAB | 4,622 | 103 | % -- first run performance_comparison.m
% -- expected directory structure:
% -- [raw_data]/[model_name]/[dataset_name]/models_stats_all.mat
whereami = mfilename('fullpath');
raw_data = '/Users/gustavo/git/ahof_vocalmat/vocalmat_classifier/training/.rawdata';
load([raw_data '/models_stats_all.mat']);
models_nu... |
cb6b06db2ac9e15b61124c735eeeacc630b0e95d2539b12ca6b7f03cd1ed27dd | MATLAB | 4,623 | 138 | % GENE_TREE String describing tree topology.
% (trees package)
%
% genes = gene_tree (intrees, options)
% ------------------------------------
%
% Returns for a cell array of cell arrays of trees intrees, a cell array of
% cell arrays of topological genes (for each tree one). The two-depth of
% the input/output arr... |
cc03c97f43dfd7580174529713a1985cef0b7fbc8f197d408c026ce3a9df2534 | MATLAB | 4,636 | 121 | % Gradients of O-information in Ising system with three-spins interactions
clear; clc
N = 8; % Number of spins
% Create a triangular geometry for the three-spins interactions
T = zeros(N,3);
T(1,:) = [1 2 3];
T(2,:) = [2 3 4];
T(3,:) = [3 4 5];
T(4,:) = [4 5 6];
T(5,:) = [5 6 7];
T(6,:) = [6 7 8];
T(7,:) = [7 8 1... |
b7a5015a77984758d38c641bc3c7e81c8cfb6f0a3e88b1f137be20fa1a8baeba | MATLAB | 4,637 | 131 | function data = extract_roi_ts_rest_subject_atlas_acompcor(project_dir,subject_list,subject_i,runlist,roi_list,roi_dir,preproc_dir,pipeline,TR,output_dir,filter_data,sumfunc)
% function extract_roi_ts()
%
% description:
% this function does the following:
% extracts the time series
% detrends
% remove confounds
% ... |
91c4644d2592a574a12c661715710eec90b6e42890e842e64a5907b33da40b4c | MATLAB | 4,639 | 106 | function out = taft_preprocess_wrapper_upsample_fit(job)
% out = taft_preprocess_wrapper_upsample_fit(job)
%
% Loop over ROIs, loop over blocks, call function for fitting HRF
% amplitude, reshape into design matrix.
%
% INPUTS:
% job = structure with settings for creating TAfT object, specifically:
% .H... |
beaeed8aebd5d02847606643bedf662752b155d6f31046427c6c7dd76987b9dc | MATLAB | 4,640 | 100 | function taft_runonce_create_onsets()
% taft_runonce_create_onsets()
%
% Loop over subject, load behavioral data files, extract timing of cue/
% response/ outcome for each trial for each subject, save under subject-/
% block-specific 'AROMA' directory in fMRI directory.
% Mind setting the root directory in taft_set_r... |
844f5f6e9ffe1b131d9fcd8fbe7b9ea0baedad615fd9a5576f6327f982a70dbf | MATLAB | 4,641 | 84 | function brain_data = read_freesurfer_brain( fs_subject_dir, fs_dir )
% READ_FREESURFER_BRAIN encapsulates FreeSurfer's shell and Matlab
% functions to read pial and inflated cortical surfaces into Matlab as a
% mesh object (after an anatomical scan has been fully processed by
% FreeSurfer). Mesh objects are defined b... |
fcb0e0ac99a39797be66714876f62916ec90c55de86ca36b629ac41b06a8fd76 | MATLAB | 4,645 | 132 | % VONMISES_TREE Estimates centripetal bias k of a tree.
% (trees package)
%
% k = vonMises_tree (input, options)
% ----------------------------------
%
% Returns the centripetal bias k of a tree, vector of root angles, or cell
% array of trees under the assumption that the root angles follow a
% modified von Mises di... |
622633ce12272ca7d43a1286c6a36f759a63da7c50c42296631760be134a8ad7 | MATLAB | 4,659 | 128 | %% Convert trajectory coordinates (xyztkj) to timeseries
% Creates .csv file containing time series, species, date, dataset label,
% temperature, and flash params
% Import list of dataset labels
opts = detectImportOptions('dataset_list.csv');
opts.DataLines = 2;
opts.VariableTypes{4} = 'char';
datasets = readtable('da... |
0562a5322d809b278173ddec81a24902aaed55672d90bcc44b303a14749ae498 | MATLAB | 4,660 | 144 | % ANGLEB_TREE Angle values at branch points in a tree.
% (trees package)
%
% angleB = angleB_tree (intree, options)
% --------------------------------------
%
% Returns for each branching point an angle value corresponding to the
% branching angle within the branching plane. Tree must be BCT (at least
% trifurcations... |
ac07fd4e76b846ef0fa99f620a1401ff5589a176dcad1aeded54959fbfff5950 | MATLAB | 4,665 | 108 | function nifti = io_CSIwrite_nifti1(MRSIStruct, filename)
arguments
MRSIStruct (1, 1) struct
filename (1, :) char {mustBeFile}
end
matlabError = [];
nifti = struct();
try
%open the file
fileID = fopen(filename, 'w');
%sizeof_hdr: Needs to be 348
head... |
211b53c3a38445a617c878e7be739c6cad37fdf431443385b42547521ca614e9 | MATLAB | 4,672 | 232 |
clear
close all force
warning on
hWB = waitbar(0,'checking the trials ...');
hWB1 = waitbar(0,'checking the trials ...');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
load('a0_8_timingLeftVsRight_sacExcluded.mat', 'timeOnEyeAll')
load('a0_9_timingLeftVsRight_baselineCorrected_SacExcluded.mat', 'timeOnEyeCorre... |
cfb04021caceabb4ecdf6c3dc3440a6a2ea33130de19aaa7dee9da672292b1b2 | MATLAB | 4,672 | 119 | function varargout = plot(self, objPI, varargin)
%plot - Plot a figure
%
% plot(OBJ, OBJ_PI) plots the default figure for the CalcDetectSigs
% object OBJ using the ProcessedImg object OBJ_PI.
%
% plot(OBJ, OBJ_PI, AX, FIG_NAME) plots the figure on the specified axes
% handles AX, and the particular figure speci... |
71351b5cadbb8b43c1da0cb10d79b3aed8e73ed6ccef5f34f396a6165fd3bfbf | MATLAB | 4,680 | 116 | % sim_megapress_shapedEdit.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% sim_megapress_shapedEdit(n,sw,Bfield,linewidth,taus,sys,editPulse,editTp,editPh1,editPh2,centreFreq)
%
% DESCRIPTION:
% This function simulates the MEGA-PRESS sequence with instantaneous
% localization pulses and shaped editing pulses. E... |
01b5a22c5740f094647f6eae389006691c630101ccad9d7e96442e378d2985fb | MATLAB | 4,684 | 138 | %==========================================================================
% This script performs spike-detection and -clustering using wave-clus.
%
% Lukas Kunz, 2021
%==========================================================================
% start
clear; clc; close all;
addpath(genpath('C:\WaveClus3\')); % Chaure... |
be78d205167eea40cf5f2d1426487a8253a4c94dd65b8b4bc84fb5e429cb4dab | MATLAB | 4,684 | 167 | function generateSupportReport(reportFname)
% Generate a .zip file containing a support report for Zapit
%
% function generateSupportReport(attemptLaunch,reportFname)
%
%
% Purpose
% Saves useful install info to a zip file.
%
% Inputs
% reportFname - If provided, the report is written to this location. Otherwise a
% ... |
856da34cf9f519de614c65e286a338f37d2b0387864e6b96de6cc1380aaed35c | MATLAB | 4,685 | 115 | classdef test_phase_compute < matlab.unittest.TestCase
properties
MockDir
end
methods (TestMethodSetup)
function addMockQsmFunctions(testCase)
testCase.MockDir = tempname;
mkdir(testCase.MockDir);
testCase.writeMockFunction('unwrapLaplacian.m', [
... |
2053d68951de7abccb963c74a4ab333c7c9bf799234f16b98e73fbb424eed21f | MATLAB | 4,686 | 116 | classdef CalcDiameterTiRS < CalcDiameterXSect
%CalcDiameterTiRS - Class to calculate diameter using the TiRS approach
%
% The CalcDiameterTiRS class is Calc class that implements all basic
% functionality related to calculating the diameter of images using the
% thresholding in Radon space (TiRS) algorithm. For f... |
b73450aecb96d33c8d8837e91fc7aff11fcab391d5f532b5738a039e459101c3 | MATLAB | 4,687 | 125 | classdef Test_CalcMeasureROIs < matlab.unittest.TestCase
%Test_CalcMeasureROIs Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties
end
% ===================================================... |
58f641ce81220e42d23dfd7303f9b397240a645902ad138eea4cba70855c7aeb | MATLAB | 4,698 | 133 | function [chSeq_dn] = denoise_VBM3D(chSeq, paramsIn)
%denoise_VBM3D - Denoise an image sequence using the VBM3D approach
%
% 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.