sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
552949ca98551b22e69c963e073063666d52cca4e208c886d248d4d5944682a0 | MATLAB | 2,813 | 67 | function [emision_sequence_cross, info] = make_sequences_cross(DATA_and_MARKER_binned, n_seq_for_trial, info, str_save_append)
%% Function to generate emission sequences of neurons for leave-one-out cross-validation
%% authors: Stefano Diomedi
%% date: 22nd February 2024
%
%% Inputs:
% DATA_and_MARKER_binne... |
c217135b09a7871e280e4ce24c0faeee82a96c58c29e427b05cf89a1d8e4fcb5 | MATLAB | 2,813 | 94 | function dwi = smoothing(dwi, kernelsize, width, csfmask)
% Isotropic smoothing of dwi data, mainly in order to reduce
% the Gibbs ringing. It might be recommended to only smooth the
% high SNR (or low b-valued) data in order not to alter the
% Rice distribution of the low SNR data. This important to maintain
... |
f5bdc5b1c2a616e8ddc625cb8d6ba31a68defe9d7f9895cddf014d78881dba94 | MATLAB | 2,813 | 88 | function out_data = img2atlas(atlasnii,atlaslist,image,varargin)
% IMG2ATLAS finds regions to which voxels of an image belong, for a given
% atlas.
%
% OUT_DATA = IMG2ATLAS(ATLASNII,ATLASLIST,IMAGE) gets the atlas nifti file
% ATLASNII, list of regions ATLASLIST and the image nifti file IMAGE and
% fits the image... |
96427aebaeb2b492dfca0fd1c8cf7f8daaae2e16f9abb161861a036c41afdda6 | MATLAB | 2,814 | 87 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This computes stats for Figure 6C.
close all
clear all
clc
LOCAL_OUTPUT_FOLDER = './local_output';
availableFiles = dir(fullfile(LOCAL_OUTPUT_FOLDER, 'train_predict_different_days_cells_stable_*.xlsx'));
nFiles = length(availabl... |
398a51b3e47a8fd86b96e300ed0bc5cf7dda7cc75962a20c9d028a2f3e07c54d | MATLAB | 2,815 | 52 | function H = readIBWbinheader(FFN);
% readIBWbinheader - read BinHeader segment of Igor IBW file
% H = readIBWbinheader('foo') reads BinHeader of file Foo.ibw
% IBW version 2,5 only
MAXDIMS = 4;
fid = fopen(FFN,'r');
H.version = fread(fid,1,'int16');
switch H.version,
case 2, % typedef struct BinHeader2 {
... |
9e79473da753d30b4b8db5dfd97860c9943c1c418921a78897fffff5497093de | MATLAB | 2,815 | 61 | function [module] = createModule(nsides,mdimension)
%CREATEMODULE Automatically derive perimeter points of module
% This is an automated function of MOCA meant to facilitate making a
% regular shape. A regular shape is defined as equiangular and
% equilateral. The first three regular polygons that can tessellate ... |
aa744665229af2aea02842bfa69c0acf46468970c75de4c11f9867038978a6e6 | MATLAB | 2,815 | 90 | % »ñÈ¡µ±Ç°ÎļþµÄ·¾¶
fullpath = mfilename('fullpath');
[path,name]=fileparts(fullpath);
Acc = [];
Left = [];
Right = [];
AllLeft = [];
AllRight = [];
% Ñ»·¶ÁÈ¡Îļþ¼Ð
for i = 1:50 % ÒÀ´Î¶ÁÈ¡50¸öÎļþ
if i<10
SubFolderFiles = [path,'\sourcedata\sub-0' num2str(i) '\'];
else
SubFo... |
aaa72f6878d1a81cd44aee77f7818bdc855878fe1d5cdd66430a8760a2e33d2a | MATLAB | 2,816 | 60 | function subject_power_2014_FD_only_parse_octave(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,output_dir)
% FD parsing Nipype wrapper pulling in list of motion files
% Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store
% values appropriately in the 51x51x3 cell array of stru... |
4f68df10353ad11561ad3e725175eba5dfe979deb1f933937a6349aa4b52cb95 | MATLAB | 2,817 | 81 | function chanData = cx2dat(filename, chanAmt, samplerate)
% Assume sample rate of 500
if ~exist('samplerate','var')
samplerate = 500;
end
%% Open
behavior = readcxdata(filename, 0, chanAmt);
if isempty(behavior.data)
warning('Something went wrong!')
disp(filename);... |
bf613304d2614beaf13df5d2776e7064df99c874b010748da9b0ab57b4e279c4 | MATLAB | 2,817 | 76 | classdef MLArenaCircle < MLArena
properties
diameter_cm;
end % properties
methods
function obj = MLArenaCircle(referencePointsVideo, diameter_cm)
% Validate the inputs
if ~all(size(referencePointsVideo) == [2, 4])
error('Must referencePoi... |
d8c5adb83bac85e70bc846f59b31c1973275fd2cad3ce75243adde8bee90e406 | MATLAB | 2,817 | 93 | function [h,CI] = variance_homogeneity(x,y,condition)
% Compares variances using a 95% percentile bootstrap CI.
%
% FORMAT: [h,CI] = variance_homogeneity(x,y)
% [h,CI] = variance_homogeneity(x,y,condition)
%
% INPUTS: x and y are two vectors of the same length
% condition = 0/1 (default=0) to condi... |
00215a26b32ea8ef67dbff5ab079052dd10b1e339de953781ca32f62da76175e | MATLAB | 2,818 | 103 | %% Code simulating a the stochastic dynamics of the projection on the
% geometric mental line of the network state receiving as input the
% symbolic distance of the presente pair of items.
% Figures resulting from this simulation/script and the related analysis
% provided the material to compose Fig. 4 ... |
6e0651eb7ec3c9fde29cef718eaf6cb131a6c95121c073a810fa4b77aae5ba12 | MATLAB | 2,818 | 83 | function [hrf,params] = getHRF(params)
% Function to get HRF according to the params.analysis.hrf.type:
% Options:
% 1. 'spm' : SPM HRF
% 2. 'vista' : vistasoft HRF
% 3. 'library1' : Kendrick Kay's canonical HRF library
% 4. 'library2' : Vistasoft's canonical HRF library
% 5. 'opt' : Use optimize... |
82c7169f65a914d2b34278da2efc888021ef88e9d62ebf75e56e4d7cdf64e1d8 | MATLAB | 2,818 | 83 | % returnSelectMetaDat.m
%
% Function that takes in metaDat struct, metaDat variable, and condition to
% filter on for the metaDat variable and returns indices of valid data as
% well as metaDat struct with only the valid rows.
%
% Operates on either single variable or cell array of them. For numerical
% variables, co... |
89817d8b7419e6cc1ea91f8a4013b1c22be85eadb8a58fc64dc57a2a9f38ea20 | MATLAB | 2,818 | 99 |
function ds_info=process_ds_info_classification(ds_info, ds_config)
class_info=ds_info.class_info;
img_num=length(ds_info.img_names);
class_idxes_mask_dir=fullfile(ds_info.ds_dir, 'my_class_idxes_mask');
mkdir_notexist(class_idxes_mask_dir);
fprintf('generating new masks encoded by class indexes...\n');
class_la... |
a8dfb48882d4f13152c024fefa181336efe179c88a33313be84fc62b890e1d9e | MATLAB | 2,818 | 60 | function subject_power_2014_DVAR_only_parse_octave(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,output_dir)
% FD parsing Nipype wrapper pulling in list of motion files
% Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store
% values appropriately in the 51x51x3 cell array of st... |
be8c31c8a92cf7d500dcc59500225b4fa0a92a37d3204ffdaf56d7fbca80ee81 | MATLAB | 2,819 | 85 | % analyzeBasicFWA_fictrac.m
%
% Function to compute fluorescence weighted average for each ROI on the
% FicTrac parameters. Saves the output in a pData file in the same folder.
%
% Note that this is the basic version of this function, such that it does
% not account for temporal correlations in the FicTrac outputs.... |
3976a93a68bf75bbc3f2c3d0df3d89c169c0f517a2108ba35ea82663625bba38 | MATLAB | 2,820 | 85 | function img_out = imgSubRowShift(img_in, buf_sz, x_off, y_off)
% img_out = imgSubRowShift(img_in, buf_sz, x_off, y_off)
%
% Subselect part of an image with per-row shifts. This sub-function was
% cluttering up the min function and was stand-alone in it's functionality.
%
% Inputs
% - img_in Input image to be s... |
19a22958f0b8bd20eb886222a11c1eb08d48be9a32c6149b63ce370d65cfd22a | MATLAB | 2,821 | 68 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [PerCell, success] = compute_percell_for_table(MapsData, ROTATIONS_DEG, CONTEXTS_TO_REFLECT_MAPS, MIN_DIFFERENCE_FOR_MAX_CORRELATION)
PerCell = [];
success = true;
wb = [];
% ROTATIONS_DEG = [0, 90, 180,... |
4af9f033c4b6d02d77fe67b3e27d3a05660837486c3429216acf4446401d134c | MATLAB | 2,821 | 99 | [filenames_TT_S1,filenames_VT_S1,filenames_TT_S2,filenames_VT_S2,tetrode,Cluster1,Cluster2] = textread('fileinfo.txt','%s%s%s%s%d%d%d');
NN=size(filenames_TT_S1);
N=NN(1);
cellnumber=csvread('fileinfo.csv',0,5);
for k=1:N
X=filenames_VT_S1{k}
Y=filenames_TT_S1{k}
VT = csvread(X,2,0);
TT = csvr... |
58b1b73a605fcb778e8325997bd3f0b305768c0d78ac5e527e3afbaa6631d954 | MATLAB | 2,822 | 88 | % getFictracFromBouts.m
%
% Helper function for saveSpikerate_bouts() that takes in indices of
% yaw velocity peaks (peak, start, and end) and returns FicTrac values
% aligned to the velocity peak
% To allow averaging over different bouts and the inconsistent frame rate,
% interpolate to specified frame rate
%
% INP... |
7c477a20796d898dec543bcdb632ea5a88cbdd7c351ec1bed989067245578ea6 | MATLAB | 2,824 | 76 | % function demoIonut
% This demo shows how to use the software described in our ICCV paper:
% Segmentation as Selective Search for Object Recognition,
% K.E.A. van de Sande, J.R.R. Uijlings, T. Gevers, A.W.M. Smeulders, ICCV 2011
%%
fprintf('Demo of how to run the code for:\n');
fprintf(' K. van de Sande, J. U... |
8940a154714ab2e999831201f98568f4dc96833f832694f3588e20a5982eccdd | MATLAB | 2,825 | 124 | function struct2File( s, fileName, varargin )
%Write struct to text file. The data in the struct can be both numbers and
%strings. The first line in the file will be a row with the headers/names
%of the columns.
%Ex: struct2File( s, 'c:/test.txt' );
%Ex: struct2File( s, 'c:/test.txt', 'precision', 3 ); %specify precisi... |
0fe5ae5a490de1155d7f6de1ae85bc373f2a68c47df33a3d4af95e15381f649c | MATLAB | 2,826 | 64 | %% Run Autostitch and save pano.jpg to /masks directory.
%% load mask made by U-net
maskc = zeros(figsize,figsize,size(targetim_L,1)+1,'uint8');
dbregma = bregma-[4024/2,3036/2];
for i = 0:size(targetim_L,1)
vidimage = imresize(imread(strcat('C:\Users\RVIS\Documents\PIMikroMoveMacro\',filename_image,'\masks\standar... |
8b273b1a4e71ce3b875c849d1574ef6726ed1d4f924d1efc8de6a9d2e5ef2ad3 | MATLAB | 2,826 | 77 | % mglUpdateTexture.m
%
% $Id$
% usage: results = mglUpdateTexture(texture, image)
% by: Benjamin Heasly
% date: 03/18/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Update an existing texture's image contents.
% texture - a texture str... |
e6f28a092a4645bfab2686b977b54cadd07f627a3d72213efffb4de67371fc93 | MATLAB | 2,827 | 49 | function [ currentTrack ] = CutTrackByLocalFrame(currentTrack, startFrame, endFrame)
% Takes a list of tracks and filters them based on start and end frames.
% the start and end frames are defined in relation to the first frame of
% the track
% Detailed explanation goes here
my_frames = 1:length(currentTrack.Fra... |
cd5dcfb081ed869ae9eed96e658a3c39ff1f9a2a2e9d94a0b7247e649b5c271e | MATLAB | 2,828 | 88 | % collectPData.m
%
% Function to copy all pData in date folder(s) to a pData folder. Renames
% pData file to include experiment name in front.
%
% INPUT:
% dateFolderPaths - [] if gui to select one date folder; otherwise,
% cell array of full paths to date folders
% pdPath - full path to pData folder
%
% OUT... |
79eea80e906708f6011517346dc5e215928efc5bfdb2affbc99a3482fbd13163 | MATLAB | 2,829 | 67 | classdef RECORDINGMODE_SURVEY < RECORDINGMODE_COMMONMETHODS
% Object with properties and methods to analyse survey fields from
% PerceptPC json file at NCN lab
%
% Available at: https://github.com/NCN-Lab/DBScope
% For referencing, please use: Andreia M. Oliveira, Eduardo Carvalho, Beatriz Barros, C... |
01764d5f0348b028f65f092fdbc58393bb83799fd0a383008b9f039c34b21cc2 | MATLAB | 2,830 | 92 | %calculates event related fields
%1.select trials of specific condition
%% Load clean MEG file
%folders
data_folder='/rds/projects/j/jenseno-avtemporal-attention/Load/proc_data/';
%/rds/projects/2017/jenseno-01/Tjerk/Load2/proc_data/';
%set path
addpath /rds/projects/j/jenseno-avtemporal-attention/MATLAB/fieldtrip-202... |
5be326d24dbd8e1e395b4405f10b176c6089309b3b682cf431f2a36d0e10ff6e | MATLAB | 2,830 | 84 | function [behaviorDat, shiftAmt, shiftConfidence] = alignCXandMaestro(behaviorDat, ephysData, plotOn)
% Don't plot by default
if ~exist('plotOn','var')
plotOn = 0;
end
shiftConfidence = 0;
shiftAmt = 0;
eSamplerate = 50000;%ephysDat.samplerate;
%ephysData = datchandata(eph... |
e7f2d50cc55474fbf5bb3a9c721e91becccac9dfbf4a22758dc4ce96852e7156 | MATLAB | 2,830 | 70 | function mltp_nlx_mclust_remove_invalid_t_files(obj, session)
% Get a list of the tfiles
tFilenames = dir(fullfile(session.getSessionDirectory(), 'TT*.t'));
nvtFilename = fullfile(session.getSessionDirectory(), obj.Config.nvt_filename);
numTFiles = length(tFilenames);
%[nlxNvtTimeStamps_mus, Ex... |
d46b507d414511c85b7d86d0bc12ece4493b4cdc38c3b483fcbb7c4d4432895b | MATLAB | 2,831 | 127 |
function cnn_global_init_fn(train_opts, imdb, work_info, net_config)
input_task_num=length(work_info.ref.task_info.task_idxes);
work_info.ref.input_task_num=input_task_num;
do_init_net_info(train_opts, work_info, net_config);
do_init_dagnn(train_opts, work_info, net_config)
end
function do_init_net_info(train_o... |
39b75d5334c5d2f3991087eacdb9033ec55d463d75a32a8a5744d28444ed654e | MATLAB | 2,833 | 96 | function network_analysis(DATA,ROI,AddInfo)
%
% This Aedes plugin calculates and displays partial correlations from ROIs
%
if AddInfo.isDataMixed
% Make data a 4D-matrix if it is loaded in aedes as a stack of 2D or 3D images
DATA2{1}=DATA{1};
DATA2{1}.FTDATA = zeros([size(DATA{1}.FTDATA,1),...
size(DATA{1}... |
480474e3e1b4ae16955402db0d0571b3ba71dd876fccfa8e06e94a2e9fce03c5 | MATLAB | 2,834 | 79 | % callSwingStanceFrames.m
%
% Function to call swing phase and stance phase for each leg on each video
% frame.
% If the leg and ball move in the same direction, leg is in stance. If the
% leg and the ball move in opposite directions, leg is in swing. So,
% comparing leg velocity to FicTrac fwdVel, same sign is sta... |
bd93f70e23e10a3a99463468a15dcf8b6c86d86d82c91ab70e90875f9ed4fcec | MATLAB | 2,834 | 88 | function data = spm_chi2_plot(action,arg1,arg2,arg3)
% Display a plot showing convergence of an optimization routine.
% FORMAT spm_chi2_plot('Init',title,xlabel,ylabel)
% Initialises the plot in the 'Interactive' window.
%
% FORMAT spm_chi2_plot('Set',value)
% Updates the plot.
%
% FORMAT spm_chi2_plot('Clear')
% Clear... |
aaab735f9f1bb0a1316711b68e41f65a4a83af8618071b2f6a14287f9b8384af | MATLAB | 2,835 | 132 |
function my_load_legacy_model(snapshot_dir, net_config)
fprintf('check snapshot: %s \n', snapshot_dir);
exp_info=[];
saved_net_config=do_load_net(snapshot_dir);
if isempty(saved_net_config)
return;
end
if isfield(saved_net_config.ref, 'dag_group_flags')
assert(all(net_config.... |
ec18f5ef699369342b7e416f4ce01cebaa13c9a84e196c0f730fe3b2c1b8c9c3 | MATLAB | 2,835 | 50 | function [ currentTrack ] = CutTrackByFrame(currentTrack, startFrame, endFrame)
%Takes a list of tracks and filters them based on start and end frames.
% the start and end frames are defined in relation to the first frame of
% the experiment
% Detailed explanation goes here
filteredIndecies = find(currentTrack.F... |
4f3e364191e21907bc3300a8d9c6074d7cb0e47536d88042d94221cce9f42eda | MATLAB | 2,836 | 77 | function plot_placemaps(obj, session, trial)
trialResultsFolder = trial.getAnalysisDirectory();
outputFolder = fullfile(trial.getAnalysisDirectory(), obj.Config.placemaps.outputFolder);
if ~exist(outputFolder, 'dir')
%mkdir(outputFolder);
error('The folder containing the placemap data does ... |
92fa2c62e15e1b85f5ea984abb3cc04ab86bd420401a8dddaa46c4cdd296cefe | MATLAB | 2,836 | 70 | % mglMetalSetViewColorPixelFormat: Set the color pixel format of the mglMetal view.
%
% $Id$
% usage: mglMetalSetViewColorPixelFormat(formatIndex)
% by: Ben Heasly
% date: 04/25/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Sets a non-default col... |
b0e3caddf57f906ca39274b1375f5df86b87b19ee487c68519f0183d4ce75a30 | MATLAB | 2,836 | 59 | % This script computes the induced surface charge density for an
% inhomogeneous multi-tissue object in an external time-varying magnetic
% field due to a coil via a BEM/FMM iterative solution with accurate
% neighbor integration
%
% Copyright SNM/WAW 2017-2020
%% Parameters of the iterative solution... |
7bf4e58b4116c493fa5a94638de869a935d9ac540e716dea48bf4fc04dabeb9e | MATLAB | 2,837 | 97 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R] = compute_withheld_trial_two_labels(Maps, mapLabels, NORMALIZE_MAPS)
% Maps needs to be a (height, width, num cells) matrix
% Map labels needs to be the same size as num cells and only contain
% one of two la... |
8b84d8cfdaa1366e65a1b5099bd9dc43cf6eb4cf84c1a81211c8dc7e983a758a | MATLAB | 2,837 | 58 | % This script computes the induced surface charge density for an
% inhomogeneous multi-tissue object in an external time-varying magnetic
% field due to a coil via a BEM/FMM iterative solution with accurate
% neighbor integration
%
% Copyright SNM/WAW 2017-2020
%% Parameters of the iterative solution... |
8dc06450eb35d3b7d97c346f2dcfaa64bbbf68256ca235449ffd918ee664aa44 | MATLAB | 2,837 | 97 | % mglGluPartialDisk - draw partial disk(s) at location x,y
%
% $Id$
% usage: results = mglGluPartialDisk(x, y, isize, osize, startAngles, sweepAngles, color, [nslices], [nloops], antialiasing)
% by: Benjamin Heasly
% date: 2022-03-17
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL s... |
aec594d90126ad153af92c4306704a1651f3d5140108cbb592cc95ca38a7d50e | MATLAB | 2,837 | 83 | % VL_PEGASOS [deprecated]
% VL_PEGASOS is deprecated. Please use VL_SVMTRAIN() instead.
function [w b info] = vl_pegasos(X,Y,LAMBDA, varargin)
% Verbose not supported
if (sum(strcmpi('Verbose',varargin)))
varargin(find(strcmpi('Verbose',varargin),1))=[];
fprintf('Option VERBOSE is no longer supported.\n');
en... |
2dffd5154bd58a1bca9b90496c7b6daf326d72b777efefd9ac2b352149ff8f72 | MATLAB | 2,839 | 68 | % Final Regression Script
clear all
clc
cd('M:\Matt Chilvers\OneDrive - University of Calgary\PhD_Projects\Project3_WhiteMatterLesion\Scripts\AllRevisionsAnalysis\RegressionAnalysis_Uncontrolled')
SetUpDataForRegression
ScrubData
clc
load('M:\Matt Chilvers\OneDrive - University of Calgary\PhD_Projects\Proj... |
ff3449f3555ad1b0d7c258b5e6dd041017e361e5025173efcbf7d38fa5617ffe | MATLAB | 2,839 | 82 | function [newVectors, whiteningMatrix, dewhiteningMatrix] = whitenv ...
(vectors, E, D, s_verbose);
%WHITENV - Whitenv vectors.
%
% [newVectors, whiteningMatrix, dewhiteningMatrix] = ...
% whitenv(vectors, E, D, verbose);
%
% Whitens the data (row vectors) and reduces dimension. Return... |
4ea13f7a21889dc9f7845ec7fff00d2c5cc2f35a9f29ce696c02b32734f3e5f4 | MATLAB | 2,841 | 85 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [v_max, vind_max, dig_pairs_max, rotationsDegUsed ] = ml_alg_bfo_and_behaviour(rotationsDeg, maps1, digs1, maps2, digs2, disjointMaps, MIN_DIFFERENCE_FOR_MAX_CORRELATION)
numRotations = length(rotationsDeg);
rotation... |
c86bf95fbac91c70e0a94fb972ffd02a692c04007030c0cd7d51c087eb10874d | MATLAB | 2,841 | 76 | function trajLoop(Nelecs,Nunits,ShowUnits,spikes,nose,uu,ff,figPos)
% presents place fields over trajectories
%modified from amapOF. Oct 2016, ehud.
%
globals;
baseFig=100; Nrows = 4; Ncols = 4;
%% place field pars
SHOW_TIME = [0,600]; %s, session time to show
TRAJECTORY = 'so'; %'xy', 'so'
%% plots loo... |
2f1f2d68ddf02dd4e74dc932d44c1cbc6b1ecbd638b925e02a255564ff2bccd1 | MATLAB | 2,844 | 78 | % plotAllKernelPred.m
%
% Function to plot all kernels, variance explained scatterplots, and
% measured vs. predicted responses for all kernels when given kernels
% struct and the corresponding kernelParams and kernelResampInputs structs
% generated by extractAllKernels().
% Calls plot1KernelPred()
% NOTE: for a fly... |
7bb0e3ad5e3bd85c85cc734f085eaff7ecb8d4425fbfbe865656c4a4b0e91c95 | MATLAB | 2,845 | 105 | function [Y,D] = get_binned_Y(param,D,condition,bin_size,speed,ds_events,d)
type=param.type;
stat=param.stat;
extype=param.extype;
exthresh=param.exthresh;
be=param.be;
beginning=be(1);
ending=be(2);
% INPUTS
% D : ds_events
% condition: 'PV' or 'SOM'
% bin_size: argument for getSeq
% b: how much time to... |
d7e01e0be78d477f6eea4889363e9b409d8e3f43c8e77a0dde8ef4b7fe891182 | MATLAB | 2,845 | 63 | % mglMetalExecutableName: Returns the full path to the mglMetal.app bundle.
%
% $Id$
% usage: mglMetalExecutableName
% by: justin gardner
% date: 09/27/2021
% copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING)
% purpose: Returns the full path of the mglMetal.app application
% ... |
029cfa893fe94d9212d39fff4dd64dad83fb5244b67b22587eef232bf91e3d7c | MATLAB | 2,846 | 76 | function simseq_motionCorrect(sessionDir)
% simseq_motionCorrect(sessionDir)
%
% Function to apply within and between scan motion correction for simseq experiment
%
% Within scan motion correction is relative to the 8th frame of each scan
% (see params.motionCompRefFrame = 8; % reference TR for motion correction)
% Be... |
469eea58c56d7c96a68375ac32965feb11d2652af4347e5edb3d068127e910c0 | MATLAB | 2,846 | 81 | %% Read in each trial's timestamp.dat file and then write to a new combined timestamp.dat file.
function ml_miniscope_pipeline_concatenated_make_timestamps(session)
scopeTimes = {};
numTrials = session.getNumTrials();
for iTrial = 1:numTrials
trial = session.getTrial(iTrial);
c = trial.getT... |
df75a96419d6867682eb194aa07b7599b2fe70f5d87c0a66a158631ecad62c1c | MATLAB | 2,846 | 77 | function GBMoutput = GBMoptimalcontrol(p,initialcondition,bounds,guess,mesh)
% function to find the optimal treatment regimen using GPOPS-II
% Called by: OCHiPerGator.m
% Uses: gliomaImmunotherapyContinuous.m, gliomaImmunotherapyEndpoint.m, GBMFuncoptimal.m
% Parameters:
%---------------------------------------------... |
56a17afd774e6db6ef3fffe4852486d71982b4895c8de4e26f490470ba748225 | MATLAB | 2,848 | 86 | function mlgp_create_placemap_database(obj, session)
fprintf('Creating placemap database (normal) for session %s\n', session.getName());
numTrials = session.getNumTrials();
numCells = [];
maps = [];
trialIds = [];
contextIds = [];
cellIds = [];
tstart = tic;
for iTrial = 1:nu... |
9acf0bbf10624d10dfa792c17bca19bc02bfe7907c9b8af7b926ee86334660cf | MATLAB | 2,848 | 105 | function FilteredNetwork = filterHarmonics(A, weights, sigma, rm_neg)
%filterHarmonics filters a network based on its Laplacian harmonics.
%
% Usage: FilteredNetwork = filterHarmonics(A, weights, sigma, rm_neg)
%
% Inputs:
% A: a network's adjacency matrix (must be square and symmetric).
% weig... |
4df0e9d092ae66894ca2c1e9a7a223382478a1a5c3ac04bc2e3644e48e1355f8 | MATLAB | 2,850 | 92 | function [I,value] = madmedianrule(a,type)
% Returns a logical vector that flags outliers as 1s based
% on the MAD-median rule described in Wilcox 2012 p 97.
%
% FORMAT: I = madmedianrule(a,type)
%
% INPUTS:
% a is a vector or matrix. In the latter case,
% the MAD median rule is applied column-wise.
%
... |
f72bd1ad5adc7113be6a5888e12d75c6f667e1b67fc49714a1144ff41c55e200 | MATLAB | 2,851 | 54 | % Statistical Parametric Mapping
% Version 8.3 (SPM8) 14-Jan-2010
%__________________________________________________________________________
% ___ ____ __ __
% / __)( _ \( \/ )
% \__ \ )___/ ) ( Statistical Parametric Mapping
% (___/(__) (_/\/\_) SPM - http://www.fil.ion.ucl.ac.uk/spm/
%_______________... |
b005b61c700f688ef2e87cc474ed18f83cbd7260db51b316f7d27e471009f10e | MATLAB | 2,853 | 49 | function feat_contr = extr_lowLevl_contr( feat_prop, feat_bkg, feat_surr)
nPatch = size(feat_prop.x, 1);
%% contrast to the pesudo background
feat_contr.bkg_colorArr = abs(feat_prop.colorArr' - repmat(feat_bkg.colorArr, [1 nPatch])); % color vector
feat_contr.bkg_RGBHist = hist_dist( feat_prop.RGBHist, repmat(f... |
bba18ef35cfa2ba4c3bfacdcbb0a997b9fa8bf8c8e717e932ce02549406d7b00 | MATLAB | 2,853 | 74 | function [params, s_new, avg] = denoise_avg(params, s, state)
% DSS denoising function: Quasiperiodic averaging
% [params, s_new] = denoise_avg(params, s, state)
% params Function specific modifiable parameters
% params.tr Trigger indices
% params.fs sampling frequen... |
2fb3efe9172247c993f61be4668320503f25f3a0466a2a38d0817d784d8a1ed1 | MATLAB | 2,854 | 87 | % plotAllKernelsDateDir()
%
% Function to plot all kernels given either cell array of paths to date
% directories or uses user selected single date dir.
%
% INPUT:
% dateFolderPaths - [] if gui to select one date folder; otherwise,
% cell array of full paths to date folders
%
% OUTPUT:
% none but generates pl... |
70683e49c7e4b340a46398fc36dbe7af6f1ed25b8b48d004dd23f46b45a1cb19 | MATLAB | 2,855 | 105 | % mglTestDotsSize.m
%
% usage: mglTestDotsSize
% by: justin gardner
% date: 08/23/2023
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: To test the dots in metal - same as arcs, for issue with radius size
%
% The top and bottom half of the display s... |
0a9902bbfd15d8a13f5e1731fc0a097a6c3b5ba78832c8d76fe3df5a9f63e43c | MATLAB | 2,857 | 95 | function data = loadTimeSeriesData(timeseries, interval, downsample_factor, electrodes)
%LOADTIMESERIESDATA load time series data in a specific interval
% D = LOADTIMESERIESDATA(TIMESERIES, INTERVAL) is the
% event-aligned data for TIMESERIES in INTERVAL, specified in
% seconds. D is of shape electrodes x time.
%... |
3ed68ce9819454391b9925a9c8f9e73df64751c16def1500460a7659e699b716 | MATLAB | 2,860 | 87 | function plotWearable( obj, varargin )
% PLOTPOWER
% Plots power of total acceleration in 3-7 Hz range.
%
% Syntax:
% PLOTWEARABLE( obj, varargin )
%
% Input parameters:
% * obj DBScope object containg wearable data.
% * (optional) ax Axis where to plot.
% * rec Inde... |
1b9f4d2575f39815e805cb2d84c49401458689fae3606445b9fd7419af5ad933 | MATLAB | 2,861 | 89 | function [v_max, vind_max, rotationsDegUsed ] = ml_alg_bfo(rotationsDeg, maps1, maps2, disjointMaps, MIN_DIFFERENCE_FOR_MAX_CORRELATION)
numRotations = length(rotationsDeg);
rotations90 = floor(rotationsDeg ./ 90);
rotationsDegUsed = rotations90 * 90;
numMaps1 = size(maps1, 3);
numMaps2 = size(maps... |
a248a46472e869348c3772cfeac7d104d3d98b3bf391efdd963d3b761bbbf082 | MATLAB | 2,861 | 69 | function genTrustDesign(s)
% so clunky: set up relative paths to ensure this works on any computer.
% warning: all paths are references based on the location of this file. if
% you move the file, you break the paths.
for ii = 1:length(s)
sub = s(ii);
scriptname = pwd
[scriptdir,~,~] = fileparts(scrip... |
3170bf40c243aa4208acdca0897fae0554787235a4ab044f7477c4340df07cd3 | MATLAB | 2,864 | 68 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [PerCell, success] = compute_percell_and_behaviour_for_table(MapsData, ROTATIONS_DEG, CONTEXTS_TO_REFLECT_MAPS, MIN_DIFFERENCE_FOR_MAX_CORRELATION)
PerCell = [];
success = true;
wb = [];
% ROTATIONS_DEG ... |
7fda9c565823a3087eba094600b658f3c03f2fafb8c31eda676aebc48b5698b2 | MATLAB | 2,867 | 98 | function [scopeLedPos1, scopeLedPos2, scopePos, scopeLookRad, scopeLookRadOther] = ml_cai_behaviour_in_scope_coordinates_two_leds(scopeTime, behavTime, behavPosLed1, behavPosLed2)
pos = 0.5*(behavPosLed1 + behavPosLed2);
a = atan2(behavPosLed2(:,1)-behavPosLed1(:,1), behavPosLed2(:,2)-behavPosLed1(:,2));
b = find(a ... |
817265979192e9f192614a00c6459164eb11eec8b9b7724e88bf4085237dd046 | MATLAB | 2,867 | 69 | %first download and add the Neural Decoding Toolbox (NDT) :http://www.readout.info/downloads/
%Meyers, E. (2013). The Neural Decoding Toolbox. Frontiers in Neuroinformatics, 7:8
clear
load('uncertain_outcomecell_identify.mat')
for i=1:549
data{i}=[mean(reward.hitDF{i}(16:45,:),'omitnan')';mean(reward.roDF{i}(16:45... |
0dcfe985f849d8e022b34ab81a0cfe2015dde2a2aae8449971775c24411138a0 | MATLAB | 2,868 | 79 | function [ CSFmask] =CSFmaskThresh(dataMap, thresh, maskBrain, voxSize, numRegionComb)
%[ CSFmask ] =CSFmaskThresh(dataMap, thresh, maskBrain, voxSize, numRegionComb)
% Get the central CSF mask based on threshold and maskBrain if available
% Updated 2018-04-09, X.L. make it to handle bad R2* data
% Ref: Liu et al.... |
240e96b9814240a78d3ffd556f17743abbbfe062742c9776ccc7dedb0f5ffb27 | MATLAB | 2,868 | 86 | function mlgp_create_placemap_shrunk_database(obj, session)
fprintf('Creating placemap database (shrunk) for session %s\n', session.getName());
numTrials = session.getNumTrials();
numCells = [];
maps = [];
trialIds = [];
contextIds = [];
cellIds = [];
tstart = tic;
for iTrial... |
5171a026682a56336ddf334dace3543c9673ad0e8af2e231dc85badd940a1432 | MATLAB | 2,868 | 106 | function [] = Fig05_SongTypeRespDiffHist_shuffle()
% Same as Fig05_SongTypeRespDiffHist.m but for trial shuffled data.
GT = 'fruD'; % Fig. 5d
% GT = 'fru'; % Fig. 5f
%% parameters
Thre_SongType = 0.001;
switch GT
case 'fruD'
DataFlag_Song = [1,0,1,1,0,1,1,0,0,0,1];
xlimrange = [-1 1];
yli... |
484f0f69688e1a5145a5474ecbbe4fbebfa86a9ff8bbc8ba2b25af5989ef88d0 | MATLAB | 2,873 | 126 |
% Author: Guosheng Lin (guosheng.lin@gmail.com)
% perform segmentation prediction on user provided images.
% specify the location of your images, e.g., using the following
% folder which contains serveral example images:
% ds_config.img_data_dir='../datasets/custom_data';
function demo_refinenet_test_example_perso... |
e585a515f4b6b8a7d78f101781e319282550970e1bc11479a4340aacb066ce1c | MATLAB | 2,873 | 63 | %% Written by Eric Earl, 10/15/2014
function subject_motion_numbers_TXT_parse_v2_octave(movement_files,output_dir)
% Motion numbers parsing Nipype wrapper pulling in list of motion files
% Outputs motion_numbers to "motion_numbers.mat" file
% movement_files = {'motion_numbers0.txt', 'motion_numbers1.txt', 'motion_numbe... |
45aa19be3c5b05293ccee427fe667f503e223ab274a85101654ce3dd9d108363 | MATLAB | 2,876 | 84 | function flag = tracker_job_process(f_vid, f_bg, f_calib_or_calib, f_trks, fr, options)
% Run detect,match,segment, and link, to obtain tracks for frame range (fr)
flag = 0;
% skip if output file exists
if (exist(f_trks{end},'file'))
flag = 1;
return;
end
% open video
vinfo = video_open(f_v... |
80504d11b3c61b6c318e19af596bb99c61bb99000a10c0f840643d8b00734f7b | MATLAB | 2,878 | 70 | %first download and add the Neural Decoding Toolbox (NDT) :http://www.readout.info/downloads/
%Meyers, E. (2013). The Neural Decoding Toolbox. Frontiers in Neuroinformatics, 7:8
%%phase decoding
clear
load('uncertain_valuecell_identify.mat')
for i=1:549
data{i}=[mean(gocue.earlyDF{i}(16:45,:),'omitnan')';mean(goc... |
37140baae5fd42269d4a7bf200bf65c1d6d34c2690d314167c30364158388a0f | MATLAB | 2,879 | 101 | % plotImgMoveNotMove.m
%
% Function to plot the average dF/F summed b/w the right and left flies
% during times when the fly is moving compared with times when the fly
% is not moving. Uses the output of moveCondPairData(), which computes
% the moving and not moving periods with transitions excluded.
% Note that mo... |
f7e2ac294745ee7be32ca884d73d88fac94aeb52853ce925224a0c79c2d78c8d | MATLAB | 2,879 | 80 | function [X,Y] = tern2cart(name_E, E, name_F, F , wlimits )
%tern2cart coverts ternary to cartesian units
%
% Converts ternary coordinates (A,B,C) along any two axes (E/F) and to
% X/Y plotting coordinates. E/F can be any dimension of real numbers of
% the same size. E/F values outside the wlimits range are allow... |
93a0d591ae821af6bde753a3d133d31c476f864872254cb43108986b9328c76b | MATLAB | 2,881 | 120 | function fdf2nifti(indir,outname)
% FDF2NIFTI - Read Varian FDF files from a folder and output a single
% NIfTI image
%
%
% Synopsis:
%
% Description:
%
% Examples:
%
% See also:
%
% Copyright (C) 2011 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uef.fi>
%
% Department of Applied Physics, Department of Neurobiology
%... |
2b5bffc258476a58b1b3d53f51d56bc976d2c5772893fbd60dd92dcb8114ddd1 | MATLAB | 2,882 | 93 | function [dat] = read_nmc_archive_k_data(datafile, hdr, begsample, endsample, channelsel)
% READ_NMC_ARCHIVE_K_DATA reads data from nmc_archive_k datasets
%
% Used in read_data as
% dat = read_nmc_archive_k_data(datafile, hdr, begsample, endsample, channelsel);
%
%
% This function specifically only reads data from o... |
92b85ecf04b7c27beeca72e44fd200e5c95904323ab885c511f9df181bc4bd2a | MATLAB | 2,883 | 30 | sBehaviorAnalysis =
position_x: [5001x1 single] % x position of tip of nose
position_y: [5001x1 single] % y position of tip of nose
distance: [5000x1 single] % head s (trajectory diff from last frame)
headOrientation: [5001x1 single] %allocentric
... |
915b3d31fe69298806a768a68276990daa3261aff97afcd8b35d85bd5a69b450 | MATLAB | 2,886 | 102 | function gaborBank = gaborArrayFromScales(imageSize, thetaVector, param, plotta)
%scaling factor
a0 = 2^(1/param.N);
%the number of scale (in 6 octaves)
m = ceil(log2(imageSize(1)/2)) * param.N;
%%%%%%%%
% m = 2;
%%%%%%%%
%kai
kai = sqrt(2*log(2)) * (2^param.phai+1) / (2^param.phai-1);
%init
%gabor filter count... |
1f1f8e22d1b013a05b9b4c6b6603a7fc510435f5aea7051af989ea13bb9a78d1 | MATLAB | 2,887 | 83 | function [FA_profile, SuperFiber, fgResampled] = ...
dtiFiberGroup_FA_Average(fg, dt, numberOfNodes)
% Average FA across the fibers, along the bundle length
%
% [myFAVals,SuperFiber, fgResampled] = ...
% dtiFiberGroup_FA_Average(fg, dt, numberOfNodes)
%
% Important assumptions: the fiber bundle is compact. All f... |
6149503c60f39a3dea793348d95ab0559ae2187a6bb8fb22e2504800afee00fc | MATLAB | 2,887 | 102 | function[]= detect_redcells(percent,img,img_thresholds,redcell_vect,cell_stat,shift)
%% MAKE VARIABLEs
xshift=shift(1);
yshift=shift(2);
longImage=img.long;
shortImage=img.short;
thirdImage=img.sum_proj;
all_cellocs=nan(512,512,length(cell_stat));
%% GET MASKS
for i = 1 : length(cell_stat)
mask=zer... |
a2067b359726c6ee6655c24165cd18900d05d68ce3bb89c05e3b2418e4098fa5 | MATLAB | 2,887 | 81 | %% Read in each trial's timestamp.dat file and then write to a new combined timestamp.dat file.
function ml_miniscope_pipeline_concatenated_make_timestamps_behavcam(session)
scopeTimes = {};
numTrials = session.getNumTrials();
for iTrial = 1:numTrials
trial = session.getTrial(iTrial);
c = t... |
6c91dac4360eab786c726c3f88c70f749d90e59c2b32a00f7e9d779a6e5acd83 | MATLAB | 2,890 | 82 | function update_unitsTable(Sesname, elec,unit,field, val)
globals;
if exist('unitsTable','var') && ~isempty(unitsTable),
uTable = unitsTable;
else,
ii=1;
% the cell array doesnt work...
uTable{1,ii} = 'iUnit'; ii=ii+1;
uTable{1,ii} = 'Sesname'; ii=ii+1;
uTable{1,ii} = 'mouse'; ii=ii+... |
93bef3edfdcbf8caa7aea7d8a1700e25e21c19b77ba537d5dd8a7d11bb2c643e | MATLAB | 2,890 | 61 | function output_mat = subject_power_2014_FD_only_parse_BIDS(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,output_dir,output_prefix)
% FD parsing Nipype wrapper pulling in list of motion files
% Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store
% values appropriately in the 5... |
2e2630d5e98744fd036c8403c064708ce327cd97cb8a33ae96694cf35cca1a2f | MATLAB | 2,891 | 69 | function mltp_compute_rate_difference_averages(obj)
seqNum = [];
labels = {};
numSessions = obj.Experiment.getNumSessions();
for iSession = 1:numSessions
session = obj.Experiment.getSession(iSession);
sessionName = session.getName();
% Load the pfStats file that contains all of ... |
62803bfd22add0c09c799c44e25c00a9acfa693c26cb74e807689810e4f5667f | MATLAB | 2,892 | 81 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [T, success] = compute_bfo_stability_table_per_cell(analysisSettings, PerCell90, BestAligned, SessionsToGroups)
% Make a table of within and across and whether the cell is stable or
% unstable
%BestAligned =... |
c7ec6a00107a215b3007475ce8d47a79f2ccf33573895420606ce27bcc7aba15 | MATLAB | 2,892 | 76 | function [grad] = netmeg2grad(hdr)
% NETMEG2GRAD converts a NetMEG header to a gradiometer structure
% that can be understood by FieldTrip and Robert Oostenveld's low-level
% forward and inverse routines. This function only works for headers
% that have been read using FT_READ_DATA and NETCDF.
% Copyright (C) 2011 Ro... |
fd62f4392d4c1f2768bab7cb5110b95cda72f447a54c25d265ab81ac12190882 | MATLAB | 2,892 | 89 | % getSpikerateFromBouts.m
%
% Helper function for saveSpikerate_bouts() that takes in indices of
% ephys spiking data and returns the spike rate aligned to the velocity peak
% To allow averaging over different bouts and the inconsistent frame rate,
% interpolate to specified frame rate
%
% INPUTS:
% ephysSpikes - s... |
5e0de56a609f22d0ce87e5e9d4eb22c9651eddf29c5aee760d418e8c447881ac | MATLAB | 2,894 | 124 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [SessionsToGroups] = load_calcium_sessions_to_groups_table()
R(1).animalName = 'CMG129_CA1';
R(1).sessionName = 's1';
R(1).dayNum = 1;
R(1).dayLabel = 'Day 1';
R(1).groupId = 1;
R(1).groupLabel = 'Day... |
3636903526462bf58a6e2ae1bec204d0332a281a549abf98cd665ff037a3ba66 | MATLAB | 2,895 | 104 | function [filefilt,dataformats]=aedes_getfilefilter()
% AEDES_GETFILEFILTER - Get File Filter for uigetfile and aedes_juigetfiles
% (this is a helper function)
%
% Synopsis:
% filefilt=aedes_data_read
%
% Description:
% Returns the correct file filter for Aedes.
%
% Examples:
%
% See also:
% AEDES,... |
1bb83ad5472f8a816f65ce9dc600251cd16a6fc12748421187e16bb6669c6d75 | MATLAB | 2,896 | 103 | function path = vl_setup(varargin)
% VL_SETUP Add VLFeat Toolbox to the path
% PATH = VL_SETUP() adds the VLFeat Toolbox to MATLAB path and
% returns the path PATH to the VLFeat package.
%
% VL_SETUP('NOPREFIX') adds aliases to each function that do not
% contain the VL_ prefix. For example, with this option it... |
e0fa2748be4ec938b7a6268dd6328bacc9c04e214db8db668372d415e8f16ab1 | MATLAB | 2,899 | 94 | % Function used to remove segments of data from a set of timeseries for the
% purposes of artifact removal and data segementation.
% Input up to 5 time-locked time-series, all of which should be the same
% length (and sample rate). Function prompts user for regions of the
% signals to be censored and puts those s... |
b500a883fb36374f2cd546d6c862378fea68ff3d0244df3b8eb9132f2ad1cf80 | MATLAB | 2,900 | 95 | function [chi_res] = delta2chi_iTKD(deltaB, D, maskErode, tol)
% function [chi_res] = delta2chi_iTKD(deltaB, D, maskErode, tol)
% Input:
% deltaB: relative field shift
% D: convolution kernel
% maskErode: brain mask
% tol: converge tolerance
%
% Authors: Xu Li
% Affiliation: Radiology @ JHU
% Email address: x... |
00cae32163b7cd665e28c7cf787cac4280a9caa37df134a346d9c4a70654d987 | MATLAB | 2,901 | 87 | function distance_base_all_sessions(fig3)
%% distance_base_all_sessions plots
% the speed of the whisker at touch onset and performs ANOVA for first/ later and
% hit/miss trials conditions
ff=dir('*.mat*');
nfolders=size(ff,1);
correct=[];
y=[];
first_later=[];
per_session=nan(nfolders,4);
per_session_correct=nan(nfo... |
69bcce97e91bad0bc00852a99ac808adf691071fb02b95efb90f4f8a8892acdb | MATLAB | 2,901 | 89 | function ms = msNormCorre(ms,isnonrigid);
% Performs fast, rigid registration (option for non-rigid also available).
% Relies on NormCorre (Paninski lab). Rigid registration works fine for
% large lens (1-2mm) GRIN lenses, while non-rigid might work better for
% smaller lenses. Ideally you want to compare both on a sma... |
15a8ca6ba7ebacba986a6033da5ccab4c0e706c25c8f922313038494f05caa57 | MATLAB | 2,903 | 127 | datDir = '/Users/hyang/Dropbox (HMS)/OptoBehaviorAnalysis-Helen/AnalyzedData/220520_LegFictracOpto_1Fly';
% prompt user to select output files from saveLegStepParamCond_indpt()
[outputFNames, outputPath] = uigetfile('*.mat', 'Select avgFicTrac files', ...
datDir, 'MultiSelect', 'on');
% if only 1 f... |
42fe232c9a1a58c1caa64be788f9004247473867a04ef832862bbe89bcc34cd7 | MATLAB | 2,903 | 94 | clc, clear
close all
%% a demo script to show discard too small/too dim components after network segmentation
% you can supply any other criteria (like throw away boundary components, apply vessel masks, etc)
% all threshold can be adjusted.
% last update: 5/30/2020. YZ
%%
network_result = importdata(sprintf('%s\\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.