sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5996ca43e4c106c871b6488ef74b51f9ed10eb1f469aec28c6f119e93d9e0ee8 | MATLAB | 1,676 | 54 | % Generate the gradient weighting in MEDI
% w=gradient_mask(gradient_weighting_mode, iMag, Mask, grad, voxel_size, percentage)
%
% output
% w - gradient weighting
%
% input
% gradient_weighting_mode - 1, binary weighting; other, reserved for
% grayscale weighting
% iMag - the a... |
870e56d268996c118e1da10d74a2aa7794351bfe258997619467abc05643712d | MATLAB | 1,677 | 62 | function [tp, fp, p, n, perm, varargin] = vl_tpfp(labels, scores, varargin)
% VL_TPFP Compute true positives and false positives
% This is an helper function used by VL_PR(), VL_ROC(), VL_DET().
%
% See also: VL_PR(), VL_ROC(), VL_DET(), VL_HELP().
% Author: Andrea Vedaldi
% Copyright (C) 2007-12 Andrea Vedaldi an... |
39253193da7eccdc4af961158f7c66f9e2e8b5f795e89b0d9b097de72b756cff | MATLAB | 1,678 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
5f08f3d76192f60faa72353b11fa7c546f755a72f599f7368f36b1bcff3b8030 | MATLAB | 1,678 | 49 | clear
file=dir('ACC*restable*.mat');
k=1;
for jj=1:length(file)
load(file(jj).name)
n=length(outcome);
n1=fix(n*0.33);n2=fix(n*0.67);
go1=find(outcome(1:n1,1)==1|outcome(1:n1,1)==2);
go2=find(outcome(n1+1:n2,1)==1|outcome(n1+1:n2,1)==2)+n1;
go3=find(outcome(n2+1:end,1)==1|outcome(n2+1:e... |
9f2535b60041b541fc85e6f6c9c249b143cdb1bdab8e9860ff3138d5ee2224a6 | MATLAB | 1,678 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
ac9ca8455128e0c3dc8ef2e121acd4c7c579135b12bf450f246d4f458ea51db2 | MATLAB | 1,678 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
dd67661b764250834bf3d82bc5e6e7e6f7e62fe43fcc14c08062596b74a3efa2 | MATLAB | 1,678 | 44 | function bases = makeNonlinearRaisedCos(nBases, binSize, endPoints, nlOffset)
% Make nonlinearly stretched basis consisting of raised cosines.
% Nonlinear stretching allows faster changes near the event.
%
% nBases: [1] - # of basis vectors
% binSize: time bin size (separation for representing basis
% endPoints: [2 ... |
24f461a35da265b5a526edf6264b738e663159c2492fa1840e602b90c743b6dd | MATLAB | 1,679 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
3f06bd724fb720e77570e7cd8c4274b76acd465c7c4b79a5032f8803f99d299b | MATLAB | 1,679 | 61 | function features = getDenseSIFT(im, varargin)
% GETDENSESIFT Extract dense SIFT features
% FEATURES = GETDENSESIFT(IM) extract dense SIFT features from
% image IM.
% Author: Andrea Vedaldi
% Copyright (C) 2013 Andrea Vedaldi
% All rights reserved.
%
% This file is part of the VLFeat library and is made availab... |
9c6a98861a501b8b87c86e761ba074f45c2cb6da790120feac44d0c578ede25c | MATLAB | 1,679 | 38 | function offset = time2offset(time, fsample)
% TIME2OFFSET converts a time-axis of a trial into the offset in samples
% according to the definition from DEFINETRIAL
%
% Use as
% [offset] = time2offset(time, fsample)
%
% The trialdefinition "trl" is an Nx3 matrix. The first column contains
% the sample-indices of the... |
540d5a5559b7c573ebb9e7cdc93093cf18692bbdf34cfbdfc93a221c9e6e20b1 | MATLAB | 1,680 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
a2070057d482a755e1dea4b05306011bcc886d71c3af3d3090e98e47cea8441a | MATLAB | 1,680 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
afaa4ac594c690c4d3a0e5e8fdb68ab33ced97dc591d6f862bfe0d4a74d4d085 | MATLAB | 1,681 | 52 | function BC=betweenness_bin(G)
%BETWEENNESS_BIN Node betweenness centrality
%
% BC = betweenness_bin(A);
%
% Node betweenness centrality is the fraction of all shortest paths in
% the network that contain a given node. Nodes with high values of
% betweenness centrality participate in a large number of shor... |
ac598b7e7bd5b2479f900f5df86ed1904ba1ca66686545de83a3cbf4eca16b3f | MATLAB | 1,682 | 53 | function [tr] = ml_cai_trialresult_read( trialResultsFolder )
tr = {};
tr.trialResultsFolder = trialResultsFolder;
tr.neuronFilename = fullfile(trialResultsFolder, 'neuron.hdf5');
tr.scopeFilename = fullfile(trialResultsFolder, 'scope.hdf5');
tr.behavFilename = fullfile(trialResultsFolder, 'behav.... |
e80e9d8057c7e751b460d4e7ddc2de3f5262596180af5a65e797be1c3ad48c15 | MATLAB | 1,682 | 55 | function [varargout] = funname(varargin)
% FUNNAME compile the missing mex file on the fly
% Copyright (C) 2012, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
% FieldTrip is free softwar... |
ee41555e471864230eb136b45117702770176573ab056d2916c2190bbf04eb99 | MATLAB | 1,682 | 64 | function [templates,xx,density,sigma,lengths,L,vals2] = ...
returnTemplates(yData,signalData,minTemplateLength,kdNeighbors,plotsOn)
%returnTemplates is used by findTemplatesFromData.m to group wavelets
%mapped to the same region of t-SNE embedded space
if nargin < 3 || isempty(minTemplateLength)
minTem... |
5d99f6acedee784a76425e8b9fd97cae2659334ef1ad61d98737deaebe01a536 | MATLAB | 1,683 | 67 | %
% Draw a single bar chart of link prediction results.
%
% PARAMETERS
% methods_arg (n*1) Cellstrings of methods; may be [] to omit the method names
% submethods (n*1) Cellstrings of submethods
% precisions (n*1) Precision values
% measure The measure used
%
function precisions_plot(methods_arg, submethods, prec... |
9fa9bb71f83407dc3a9fbbe99b498012dc4475fb6e53594c7326e7529f010b20 | MATLAB | 1,683 | 51 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
f323346931c8402268ce4ddae09a8e3bdb7c322f336b8f377467692764b40961 | MATLAB | 1,683 | 43 | % Transform the coordinates and then compute the speed in the new
% coordinates. This is normally used to convert from position in
% video pixels to position in cm. Transforms from (p,q) to (x,y)
function [x,y, vtrans] = ml_core_geometry_homographic_transform_points(refP, refQ, refX, refY, p, q)
% Validate the ref... |
061321080c4536662af4cfcf6f54db5dc303cc1af2ee95bea42dc4041e79b839 | MATLAB | 1,684 | 52 | function [version_number,isImProcToolbox] = aedes_getmatlabversion()
% AEDES_GETMATLABVERSION - Returns the numerical Matlab (main) version
%
%
% Synopsis:
% [version_number,isImProcToolbox] = aedes_getmatlabversion;
%
% Description:
% Returns the numerical Matlab (main) version. The number is converted... |
40d41a34d947840f07d012b9ce81ee36edb01386053375efc50f773bea3556a6 | MATLAB | 1,684 | 43 | function tseries = read_cifti_via_csv (path_cifti,path_wb_c)
%% tseries = read_cifti_via_csv (path_cifti,path_wb_c)
% This function reads ciftis by making a csv first and then importing the
% content into matlab,
%% Some paths for testing
% path_cifti='/home/groups/brainmri/abcd/data/HCP/derivatives/dcan_abcd_pipelin... |
6da537f27522ba378ac137e381c742060af39a04719b061bbee2d32c1d6f0cbb | MATLAB | 1,684 | 42 | function [ Kappa ] = draw_lcurve( Lambda, regularization, consistency, fig )
% Draw the L-curve both in the linear and log domains.
% Calculate the curvature in the log domain and plot it as function of Lambda.
% This function outputs the curvature Kappa.
%
% Parameters:
% Lambda: vector with regularization weight valu... |
86acfebff4971b3c48a6c5dc586fce41e2512ba01ef5e1e29f7310f2fa2afd0d | MATLAB | 1,684 | 31 | function [total_score, image_score, displacement_score, centerline_pixels_out_of_body] = score_centerline_whole_image(K, Old_K, BW, dilation_size, l0)
% the score is the dot product of the image and a generated image from
% the centerline minus the displacement score
%%%find the image score, which the frac... |
c8b57f8b440a392d44e16acf8525efae9f633d9d630ebb74b450b308bc9e0217 | MATLAB | 1,684 | 62 | %% How much difference does the max iteration make?
%% set up obstacles
fig_h = get(gca,'children');
% to find the handle of the image
handleToImage2 = findobj(fig_h, 'Type', 'Image')
% reading the matrix data
Es=get(handleToImage2,'CData' )
% retrieve the axis data
x=get(handleToImage2,'xData' );
y=get(ha... |
ce5228ffaeba7a539409a84200a7df5f3ea2b7196a6c094f9087657ee30554c5 | MATLAB | 1,684 | 49 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
5c101af82ebc21f10e8ca90c3055d1a8852b363eb6da0fa0d1fc1c1e5bd35934 | MATLAB | 1,685 | 55 | function cvLFE_meta_batch(stud_dir, subj_file, MS_file, fam_vec, fam_nam)
% _
% cvLFE meta batch for analysis of the FADE data set
% stud_dir - study directory in data/analyses are located
% subj_file - an XLS file containing subject IDs and covariates
% MS_file - a MAT file containg model space name an... |
b15b3b3b89a12be5f06ecdaf6c80efd5b43110d2a4eceee9a7d3dc03b999a25b | MATLAB | 1,686 | 91 | %
% Plot curve fitting.
%
% PARAMETERS
% $NETWORK
% $DECOMPOSITION
%
% INPUT
% dat/fit.$DECOMPOSITION.$NETWORK.mat
%
% OUTPUT
% plot/fit.[ab].$DECOMPOSITION.$NETWORK.eps
%
network = getenv('NETWORK');
decomposition = getenv('DECOMPOSITION');
font_size = 18;
fit = load(sprintf('dat/fit.%s.%s.mat', decomposition, ... |
b502086cbf5c65788a7ae7e78111056adc400c4ddd87022ff75dde82a0adfa43 | MATLAB | 1,687 | 46 | % calculate the mean and variance of arbitery windows as well as its surroundings of an image using
% integral image computation
function [avg_c, var_c, avg_s, var_s] = intMeanStd(I, c, s, num_c, num_s, varFlag)
imc = size(I, 3); nPix = size(c, 1);
a_c = c(:, 1); b_c = c(:, 2); c_c = c(:, 3); d_c = c(:, 4);
a_s = ... |
37b847cf17ceea9c8653af3b943ac2699497685ac613c54ab31701fb15750963 | MATLAB | 1,688 | 52 | %{
Copyright (C) Cambridge Electronic Design Limited 2014
Author: James Thompson
Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk
This file is part of CEDS64ML, a MATLAB interface to the SON64 library.
CEDS64ML is free software: you can redistribute it and/or modify
it under the t... |
772b577924de393654e125f48efbe8a6c277863475301d1e01b8fcfe6a1f71b7 | MATLAB | 1,688 | 52 | % getRawSignals.m
%
% Function that computes average fluorescence over time in all the ROIs.
% Outputs both average fluorescence with and without background
% subtraction.
% The functions drawROIs and selectBackground must have been run first to
% define the ROIs and background region
%
% INPUT:
% alSeries - ali... |
d087023509e8037313d9a7ab36c0e11117b5bc493663923310708cb0f40e3345 | MATLAB | 1,688 | 56 | function [x, y, xi, yi, xedges, yedges] = ml_core_compute_binned_positions(x, y, boundsx, boundsy, nbinsx, nbinsy) %
% p = inputParser;
% p.CaseSensitive = false;
%
% addRequired(p,'x');
% addRequired(p,'y');
% addRequired(p,'boundsx');
% addRequired(p,'boundsy');
% addRequired(p,'nbins... |
9edb023605384c9a271bc6be992349797d0ccd96c2fd8f528d66f3fe9a4bd5ff | MATLAB | 1,689 | 57 | mglOpen()
clear mglGetKeyEventResults mglGetKeysResults;
mglListener('init');
% resultN = 1;
% startT = mglGetSecs;
% fprintf(1,'testing mglGetKeys\n');
% while mglGetSecs(startT) < 60
% mglGetKeysResults(resultN).keys = mglGetKeys;
% mglGetKeysResults(resultN).time = mglGetSecs;
% mglGetKeysResults(result... |
0960157be56665b3320e84014c8b75f503af53b06c568610c1832f2444fabb58 | MATLAB | 1,690 | 38 | % SONSETMARKER replaces the data associated with a marker on disc
%
% Implemented through SONSetMarker.dll
%
% RET=SONSETMARKER(FH, CHAN, TIME, NEWTIME, {NEWMARKERS, {NEWEXTRA}})
% FH = the SON file handle
% CHAN = the target marker channel
% TIME = the current timestamp of the target marker entry (clock ticks)... |
4b965d3fc5d1c8d24c3609ae4b8496dc590803cda6252f3eb780e790950f6bd1 | MATLAB | 1,690 | 43 | % this script create a 3-D scatter plot showing different pattern of the
% dynamics, including ON-ON, OFF-ON, OFF-OFF and ON-OFF
% 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z)
rootFolder = "figure_Iattn_0.04_2d_4000/";
% ON-ON
agree = readFilename(rootFolder+"agree/*_*_*_*_*_*.png",'%f_%f_%f_%f_%f_%f');
agree... |
2101abde8ee998a01c871d52f193cc25677e9a25971c539879a5ba57e5438e5b | MATLAB | 1,692 | 46 | %Example demonstrating peak interpolation (finds the peak of a function,
%interpolated between samples using the peak and its two neighbors).
%This example finds the peak of sin(2*pi*f*x+phi) for unevenly spaced x
N_p=10;%number of points
f=1/N_p;%frequency (relative to sampling frequency)
x=2*pi*rand(1,N_p);... |
bce7c015db92d4b4f8184d37a91da0a6a54f69b1976e7fe38718ad6b79b1ed4a | MATLAB | 1,692 | 75 | function [InputF,ResponseF,tMax] = TI_Data_Multi_Mono_Regular(n_inputs,waitT,emissionT, emissionTR, epsT, cycles, interpMode)
% TI data Generator:
% Input is a matrix whose raws represent the input channels
%
% time sequence over which interpolate data
deltaT = [epsT, emissionT, epsT, waitT];
deltaT = repmat(delt... |
e02165becbf21d1fab4cc735e3fc9d11cad3ba523ea7fd212376795916c52630 | MATLAB | 1,692 | 63 | function [outputdata] = MYapplymask4d(inputdata, maskdata)
% Apply a 3d mask to 4d data. Usage output = MYapplymask4d(data,
% mask). Input can be either a 4 dimension and 3 dimension matrix, paths
% to the nifti files, a MYnii struct or any combination thereof. Second
% dimension is time so mean(output, 2) gives ... |
7c3e89feaeb6207f3316139d8dd2b815e505958d2e9f24a2dbc2668f314b67c8 | MATLAB | 1,693 | 45 | % getCatStepValsXY.m
%
% Helper function for plotAEPPEPscatter(), plotAEPPEPContours(), and
% plotAEPPEPmeans()
% Returns step X and Y values, as well as leg calls for selected amp and
% dur, given keys. Operates on single vectors
%
% INPUTS:
% stepEPX - vector of all step X extreme positions, length n
% stepEPY ... |
f72a0e868ab9929146aa2ec41fb3ccef5ef5656ab9fbe1a2e06a7d80e3023e58 | MATLAB | 1,693 | 36 | % not used in paper
tracksByVoltage = struct('voltage', {0}, 'reversalCount', {0}, 'totalCount', {0});
for track = 1:length(allTracks)
pirouettes = allTracks(track).Pirouettes;
LEDVoltages = allTracks(track).LEDVoltages;
maxVoltage = max(LEDVoltages);
if length(find([tracksByVoltage.voltage] == maxVolt... |
668cf41bea479e1a05e2d08d68d6b32e0f51ad33df768be69934e1974230e83e | MATLAB | 1,694 | 40 | function [LNPStats, meanLEDPower, stdLEDPower] = directional_FitLNP(Tracks,folder_indecies,folders)
%directional_FitLNP takes in tracks and outputs the parameters of the LNP
%based on which behaviors transition into which other one (i.e. context
%dependnt)
load('reference_embedding.mat')
%get the number of beha... |
c20accdb3160ed0cfda5aaa8a4be3ecfb50d3ca39382c8fd62b9b485ad612c75 | MATLAB | 1,694 | 65 | function p = aedes_tdist(x,v)
% TDIST - Calculates Student's cumulative distribution function.
%
% Synopsis:
% p = aedes_tdist(X,V)
%
% Description:
% Calculates Student's cumulative distribution function with V
% degrees of freedom at the values in X.
%
% Examples:
%
% See also:
% AEDES_FMRI... |
45e2177831a3fd31a5439421f1ae075bf46b3e3964d58d07e303ad2faa4e8443 | MATLAB | 1,696 | 56 | % computeBaseline.m
%
% Function that takes in background-subtracted fluorescence signal over
% time, performs bleaching correction (sum of two exponentials), and
% returns baseline values at same time points as fluorescence signal.
% For bleaching correction, fits sum of two exponentials to portion of
% fluorescenc... |
3cd25a2f8243bc2aeeaf3759321c8fb00ed1a356448a8fd1648717664090a47e | MATLAB | 1,697 | 49 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [hFig] = plot_per_day_animal_averaged_rate_difference_matrix_table(T)
%T = compute_per_day_animal_averaged_rate_difference_matrix(DaysToSessions, RateMatrices, perCellNormalizationMethod, perAnimalNormalizationMethod);
... |
c0e21de7f3309dd9b4e95b7eede3f4af38b6450fc8cf790d80c6a8bf5d94dd89 | MATLAB | 1,697 | 48 | function fix_SetFrameNumber(handles,hObject)
% show the current frame
% splintered from fixerrorsgui 6/21/12 JAB
if nargin < 2,
hObject = -1;
end
if ~isfield( handles, 'seq' ) % maybe during initialization
fprintf( 1, 'ignoring uninitialized handles during frame slider callback\n' );
return
end
if hObject ~=... |
932f952bdd9db7ffd5448deba270ad6da2015fd66b4f2f17593ee52f97336b84 | MATLAB | 1,698 | 68 | <<<<<<< HEAD
function [imsVector, imsVectorREJ, NIRA, REJnira] = ims2Vec(ims, matching_type)
% initialize vector
imsVector = [];
imsVeectorREJ = [];
k = 0;
w = 0;
% ciclo tutta la matrice per creare l'opportuno vettore
for i = 1:size(ims,1)
% imposto J per saltare la metà inferiore della matrice se necessario
... |
bf05eab5dc09fa710434981d5fb5ab5ce38af855cbc2c5aa5ea2197edb296824 | MATLAB | 1,699 | 70 | function USBTTL(cmd, varargin)
% USBTTL(cmd, arg); -- Set RTS line of a serial port low or high.
%
% USBTTL('Open' [,devName]);
% - Open a connection to a serial port, either the default port 'ftEGLIHC'
% device of the Videolab, or the given name 'devName'.
%
% USBTTL('Close');
% - Close connection to serial port.
%
%... |
e4c9c04d810fa59ab65cf8c6e51fe785dae4196c46ae7933cf096bdd71720fad | MATLAB | 1,699 | 50 | function dataset = vl_svmdataset(x, varargin)
% VL_SVMDATASET Construct advanced SVM dataset structure
% DATASET = VL_SVMDATASET(X) wraps the matrix X into a dataset
% structure. All the formats supported by VL_SVMTRAIN() are
% suppported here as well.
%
% DATASET = VL_SVMDATASET(X, 'homkermap', HOM) where HOM... |
8a085a1e736ea5e6f1e3663982a2f14f7f6982590db2d1472faedae35b627c44 | MATLAB | 1,701 | 49 | classdef BehavioralEvents < types.core.NWBDataInterface & types.untyped.GroupClass
% BEHAVIORALEVENTS TimeSeries for storing behavioral events. See description of <a href="#BehavioralEpochs">BehavioralEpochs</a> for more details.
% OPTIONAL PROPERTIES
properties
timeseries; % (TimeSeries) TimeSeries object conta... |
9b7085fb6c7b42d73dde7a2755dec4a9aacf7479584806f24b7c36fafea9dcc0 | MATLAB | 1,701 | 47 | function S = binSpikeTrains(evt, evm, N_node, dt, T)
% function S = binSpikeTrains(evt, evm, N_node)
%
% Function that takes a list of marked events (times in evt and marks that
% are integers in [1, N_node] in evm) and makes a spike count matrix S
% where each element is the number of spikes for each neuron (the row... |
cf24a7bc865c03a15c4941f530e0c7e16f8033b1e89c1255e79b9f8fd3618d6c | MATLAB | 1,701 | 64 | %
% Test the hypothesis of shrinking diversity
%
% PARAMETERS
% $NETWORKS Space-separated list of networks
% $STATISTIC
% $TYPE "split" or "full"
%
% INPUT
% dat/trend.$TYPE.$STATISTIC.$NETWORK.mat
% For each $STATISTIC in $STATISTICS
%
% OUTPUT
% dat/shrinkingdiversity.$TYPE.$STATISTIC Unspecified content (evalu... |
59d35c5e74758e6637c3d12d17bd7d656de206ad320bf795651ea7467edd2c89 | MATLAB | 1,702 | 40 | function [vol] = yokogawa2vol(hdr);
% YOKOGAWA2VOL converts a spherical volume conductor model that can
% be present in the header of a datafile into a structure that can
% be used by FieldTrip.
% Copyright (C) 2005, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% f... |
ab58c645cd9abf9b00f0cbf2f97b233de5eb933743a6e61145f9ed78b57c5979 | MATLAB | 1,702 | 49 | % getTaskSeglen.m
%
% $Id:$
% usage: [seglen task] = getTaskSeglen(task)
% by: justin gardner
% date: 09/17/13
% purpose: Helper function called by initTask (for precomputed segs) and updateTask
% which looks at the settings in task for seglens and computes a random
% ... |
dfdd7ddc4746e2c78893cc56a558401805d7a4226556a0b8a5e5508568ecc8cf | MATLAB | 1,702 | 47 | % A simple wrapper for MATLAB's linear discriminant analysis functionality.
%
% Inputs:
%
% input - a matrix of feature vectors. Each row is a sample. Should by
% S by D, where S is the number of samples and D is the dimensionality of
% the data.
%
% labels - a vector of class labels. Should be of length ... |
e8dac2a58137db6c8c466e4922a18179fff0df711c36043b3a1ff9ccb75c1ad6 | MATLAB | 1,702 | 53 | % mglTestTextDraw: an automated and/or interactive test for rendering.
%
% usage: mglTestTextDraw(isInteractive)
% by: Benjamin Heasly
% date: 03/10/2022
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Test rendering some text as an image.
% usage:
% ... |
5a81aaaf545b85f82488bb7e8e8951d4c42420e86758a8f0d148212556568561 | MATLAB | 1,705 | 65 | %function asdfadf()
close all
clear all
clc
nvtFullFilename = fullfile(pwd, 'VT1.nvt');
CONFIG_NVT_FILE_TRIAL_SEPARATION_THRESHOLD_S = 10;
numTrials = ml_nlx_nvt_get_num_trials(nvtFullFilename, CONFIG_NVT_FILE_TRIAL_SEPARATION_THRESHOLD_S);
fprintf('num trials = %d\n', numTrials);
%function asdfadf()
close all
cl... |
e3ca4f6dfc76001090d842fcfe509ddb90e69b14617e99e1958445a9f61efc28 | MATLAB | 1,705 | 54 | function generateCore(varargin)
% GENERATECORE Generate Matlab classes from NWB core schema files
% GENERATECORE() Generate classes (Matlab m-files) from the
% NWB:N core namespace file. By default, generates off of the most recent nwb-schema
% release.
%
% GENERATECORE(version) Generate classes for the
% c... |
bbbd6a46abd28699686084b80ae0beabf4456e0e83a6e19afa3518e5a351cb45 | MATLAB | 1,706 | 64 | % Basic script for local installation.
% Make sure you run the 'make' function first for optimum performance.
%
% Add inst directory to path
inst_dir = fullfile (fileparts (mfilename ('fullpath')), 'inst');
addpath (inst_dir)
% Check if running in Octave (else assume Matlab)
info = ver;
isoctave = any (ismember ({in... |
67b1c3029dc6f528b53e8d52436ea0bbc2627b0cf6748f734dce87a532573144 | MATLAB | 1,708 | 44 | [ha, pos] = tight_subplot(3, 3, [.03 .03],[.01 .01],[.01 .1]);
%wholebrain = [191030, 191115, 210108];
%hemis = [191030, 201125, 200115];
mouse = 191030;
load(sprintf('gradcam/%s_avg_hemis_label0.mat', num2str(mouse)));
a = ha(1);
overlay_heatmap_gradcam(example_data(64,:,:), rescale(subject_avg_gradcam, 0, 1), a, 0.5... |
b2894c2a15bb415be16db0056b6441ba20b097ea7cfd81ce56ee16fa6b9467aa | MATLAB | 1,711 | 45 | sBA =
mouse: 'Thalamus44'
date: '20160517'
session: 'Emergence'
movie: '11'
nucleus: 'POm'
whiskers: 'W'
goodElectrodes: [14x1 double]
fps: 501.7579
... |
4d83fc1b423864af0aab362f9900e74cdafd2941b33ecbaa2a7eedb2bdb6f208 | MATLAB | 1,712 | 37 | clear
file=dir('ACC*restable*.mat');
for jj=1:5
load(file(jj).name)
n=length(outcome);n1=fix(n*0.33);n2=fix(n*0.67);
go{1}=[find(outcome(1:n1,1)==1);find(outcome(1:n1,1)==2);];
go{2}=[find(outcome(n1+1:n2,1)==1);find(outcome(n1+1:n2,1)==2)]+n1;
go{3}=[find(outcome(n2+1:n,1)==1);find(outcome(n... |
d3af72e0a944e209e9498c5ed37ed430904c9f70b386518ad88cd15915455c71 | MATLAB | 1,712 | 69 | function [InputF,ResponseF,tMax] = TI_Data_Multi_Mono(n_inputs,waitT,emissionT, emissionTR, epsT, cycles, interpMode, SDist)
% TI data Generator:
% Input is a matrix whose raws represent the input channels
%
% time sequence over which interpolate data
deltaT = [epsT, emissionT, epsT, waitT];
deltaT = repmat(delt... |
7f6164afbe99f9933709bc3013c0f1e88159471e6edce361b3f29dbca282bff2 | MATLAB | 1,713 | 48 | % projPt2Line.m
%
% Function that projects a point onto a line. I.e. returns point on line
% that connects specified point to line with orthogonal line.
% User specifies slope and y-intercept of line, x and y coordinate of
% point. If these are vectors, treats each set of indicies as one line and
% point.
%
% INPUT:... |
80419cd6e3eea2a9294074f524275631c4cc46ff1b7aef00334224e64c6c5274 | MATLAB | 1,713 | 47 | classdef RECORDINGMODE_INDEFINITE < RECORDINGMODE_COMMONMETHODS
% Object with properties and methods to analyse indefinite 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, Bea... |
404bc4a8643fd3f381242e70ef11d89926679cd25a5eb9551b2e985436bcd230 | MATLAB | 1,715 | 49 | function TransPET = getTransPET(v,g)
%GETTRANSPET transient pathway current transmission
% will be very large memory
% Detailed explanation goes here
% Connectivity
p_base = [0.1184, 0.1552, 0.0846, 0.0629, 0.0323, 0.0000, 0.0076, 0.0000;
0.1008, 0.1371, 0.0363, 0.0515, 0.0755, 0.0000, 0.0042, 0.0000;
... |
9014b8ba0e4a7fcf822c7b9bfca8280ebf471d4d1ebde873e9c85c3e41f36836 | MATLAB | 1,718 | 71 | % temporary script for plotting visual stimulus behavior data
% some constants
fictracParams.dsf = 20; % downsample to 1000 Hz;
fictracParams.filtParams.padLen = 200;
fictracParams.filtParams.sigmaPos = 100; % 100 ms
fictracParams.filtParams.sigmaVel = 50; % 50 ms
BALL_DIAM = 6.46;
circum = BALL_DIAM * pi; % circumfe... |
daf8aad8c20e638523e876bb553324d43f235fb53df0410e11de1d92e0c1bc0a | MATLAB | 1,718 | 71 | function USBTTL_2(cmd, varargin)
% USBTTL(cmd, arg); -- Set RTS line of a serial port low or high.
%
% USBTTL('Open' [,devName]);
% - Open a connection to a serial port, either the default port 'ftEGLIHC'
% device of the Videolab, or the given name 'devName'.
%
% USBTTL('Close');
% - Close connection to serial port.
%... |
53452330899669a43861221e26ac757ef79e71193704d687007f41811918df44 | MATLAB | 1,719 | 56 | function [ A,B,C ] = ternary_arrays( nsim, wlimits )
%ternary_arrays build arrays for ternary calculations, equally spaced
%
% ABC is Nx3 matrix of equally-spaced ternary coordinates, with each row
% being an A,B,C triplet set. N=nsim*(nsim+1)/2, sum of 1:nism. nsim is
% the number of grid points along each of th... |
d298065df0a4a838d12d549c094ca28efe0e848896dc64c01734fc3865abefe0 | MATLAB | 1,719 | 58 | function chi_res=SFCR_m(deltaB, D_k, maskErode, maskSS, wG, lambdaSet)
% chi_M = SFCR_m(deltaB, D, maskErode, maskSS, wG, lambdaSet);
% SFCR M-step
% adopted from Lijun's Code
% used to get initial M-step estimate using the SFCR method
% using CS in k-space with L1 regularization with a priori info from Mag gradi... |
e1cb5a076e3aac8d908202c0ded08c3b17607d55522e48570e778aebf38dd467 | MATLAB | 1,719 | 54 | function [r] = issubfield(s, f)
% ISSUBFIELD tests for the presence of a field in a structure just like the standard
% Matlab ISFIELD function, except that you can also specify nested fields
% using a '.' in the fieldname. The nesting can be arbitrary deep.
%
% Use as
% f = issubfield(s, 'fieldname')
% or as
% f =... |
31d8d38d04da2af1b8ae3f1f4b9fb0616f8a49f2bc6ca73dff7139b0951ae727 | MATLAB | 1,721 | 82 | %% Create the missing links for Rossler weighted network
% Ting-Ting Gao
clc, clf, clear, close all
tic
A = csvread('rossler_weighted_adj.csv');
E = [];
ii = 1;
for i = 1:length(A)
for j = 1:length(A)
if A(i,j) ~= 0
E(ii,1) = j;
E(ii,2) = i;
E(ii,3) = A(i,j);
... |
7384db3baf31578774d31e8ad6b894caec1a1ed6ca3c75f3a94c746e1bde57f2 | MATLAB | 1,721 | 39 | function [ts_mus, x_px, y_px, angle_deg, targets, points, header] = ml_nlx_nvt_load(nvtFullFilename)
% This function was written as a interface to the lower level code from
% Neuralynx and because of a strange issue of duplicated data encoutered
% when using the officla NeuraView tool to split a session into mulitple
%... |
a566c7852638587502bd1e13be51fe4408affda8cfd73b30b36e510e278f7095 | MATLAB | 1,722 | 58 | function [ status, text ] = open_batch_folder( obj )
% Select files to open.
%
% Syntax:
% OPEN_BATCH_FOLDER( obj, multiple_files )
%
% Input parameters:
% * obj - object containg data
%
% Output parameters:
% status
% text
%
% Example:
% OPEN_BATCH_FOLDER( );
%
% Available at: https://github.com/NCN-Lab/DBS... |
dc6935a82b5d2117428348ad8916f4a890195ad477c4c9bab0246dc42d21e143 | MATLAB | 1,722 | 57 | %function update_unitsTable(Sesname, elec,unit,field, val)
clear all; %close all;
globals; initglobals;
DATA_TYPE = 'OF';
DATA_TYPE = 'EM';
%globals;
unitsTableFilename = ['unitsTable' 'OF'];
unitsTableFilename = ['unitsTable' 'EM'];
load(unitsTableFilename);
Titles = unitsTable(1,:);
aa = strfind(Titles,'... |
ec8df1a980456a4010686843dec9d6dcc3534d626facc381363944039987f7d8 | MATLAB | 1,723 | 54 | function model = tch_glm(Y, X)
% Apply a general linear model (GLM) to data in Y using design matrix in X
%
% INPUTS
% Y: TR by voxel matrix of fMRI time series data
% X: model design matrix
%
% OUTPUT FIELDS
% betas: fitted linear model weights
% residual: error of model prediction for each time point
% stde... |
3be3290eb8916f4fafcd7b36800fb838190c4164e83d39d3b960b14515fa178b | MATLAB | 1,724 | 27 | %FinalPlot=1;
if FinalPlot,
% right whiskers
Session = 'POm36';ShowUnits = [6,6;8,1;10,3;12,2]; colVars = {'theta.R';'theta.Rv'}; bef_s = 0.05; aft_s = 0.05;
Session = 'POm31';ShowUnits = [2,3;3,2;8,1;12,3]; colVars = {'theta.R';'theta.Rv'}; bef_s = 0.05; aft_s = 0.05;
Session = 'VPM28';ShowUnits =... |
83e4005f8ac04b4ee5df960ce7217636ba8ec112ddd6a849060045b93dfd9d93 | MATLAB | 1,724 | 46 | function bases = makeNonlinearRaisedCosMine(nBases, binSize, endPoints, nlOffset)
% Make nonlinearly stretched basis consisting of raised cosines.
% Nonlinear stretching allows faster changes near the event.
%
% nBases: [1] - # of basis vectors
% binSize: time bin size (separation for representing basis
% endPoints:... |
8dd5e1e791c8a424b7f4fadf9328710ebe0e80e2133e1f2011cf33d018a7e507 | MATLAB | 1,724 | 55 | %% FOR TWO-SAMPLE signrank
% This script implements a Monte Carlo simulation using the 2-sample signrank test for determining the cluster size threshold of the spatial ICA maps.
% It iteratively draws random samples from the pool, conducts statistical tests, thresholds the results, and stores the empirical distribution... |
4cd4e656dc5e46fc1831f478076e8edb1e3a0369275a761919bc0c98b8f7606d | MATLAB | 1,725 | 54 | function [s] = setsubfield(s, f, v)
% SETSUBFIELD sets the contents of the specified field to a specified value
% just like the standard Matlab SETFIELD function, except that you can also
% specify nested fields using a '.' in the fieldname. The nesting can be
% arbitrary deep.
%
% Use as
% s = setsubfield(s, 'field... |
bde1459b3379b5774e41bbaec5ab57c76753dd6cb6d35c0b8590c58a4e2190a3 | MATLAB | 1,725 | 67 | function s=treeSort(C,Sc,Tree)
% treeSort Sort coclassification matrix to be consistent with cluster tree
%
% Syntax
%__________________________________________________________________________
%
% s=treeSort(C,Sc,Tree)
%
% Description
%__________________________________________________________________________
%
% s... |
937bb7415e30c51db97582b42d5139d7ebf62aeaab3fda380df1f0abf4eb7b02 | MATLAB | 1,726 | 48 | function [Ix,Iy] = vl_grad(I,varargin) ;
% VL_GRAD Compute the gradient of an image
% [IX,IY] = VL_GRAD(I) returns the gradient components IX,IY of the
% 2-D discrete function I. I must be a two-dimensional
% matrix. VL_GRAD() computes the gradient by using finite
% differences; specifically, it uses central di... |
243b5c68ecc1a9a12e2293cb959c6385e51225c3d1099f785c24bc3072021be8 | MATLAB | 1,728 | 50 | % mglScreenCoordinates.m
%
% $Id$
% usage: mglScreenCoordinates()
% by: justin gardner
% date: 05/27/06
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Set coordinate frame so that it is in pixels
% with 0,0 in the top left hand corrner
%
fu... |
b8144908577cb4cc2632a45ca943df9e2612608472751469e5da8a0befda96f0 | MATLAB | 1,728 | 38 | % SONSETMARKER replaces the data associated with a marker on disc
%
% Implemented through SONSetMarker.dll
%
% RET=SONSETMARKER(FH, CHAN, TIME, NEWTIME, {NEWMARKERS, {NEWEXTRA}})
% FH = the SON file handle
% CHAN = the target marker channel
% TIME = the current timestamp of the target marker entry (clock... |
0c4231ac8232a58d8845b45aaaeb97bd23dff381d2d9ab6eead96c30fd702325 | MATLAB | 1,729 | 72 | function[out,h]=SONADCToDouble(in,header)
% SONADCTODOUBLE scales a SON ADC channel to double precision floating point
%
% [OUT {, HEADER}]=SONADCTODOUBLE(IN {, HEADER})
%
% Applies the scale and offset supplied in HEADER to the data contained in
% IN. These values are derived form the channel header on disc.
% ... |
1352f6e90a4bdbd6a38f1dd12a68cec27876065e23e25aa9491c4db0f7f90830 | MATLAB | 1,732 | 47 | classdef DfOverF < types.core.NWBDataInterface & types.untyped.GroupClass
% DFOVERF dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes).
% REQUIRED PROPERTIES
properties
roiresponseseries; % REQUIRED (... |
289db47c4caf8412521957900bcf142cd4a99f0c53bba1a59093ad9bb8c88206 | MATLAB | 1,732 | 37 | classdef CBIG_Yeo2011_unit_test < matlab.unittest.TestCase
% Written by XUE Aihuiping and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
methods (Test)
function test_example(testCase)
CBIG_CODE_DIR = getenv('CBIG_CODE_DIR');
load(fullfile(CBIG_CO... |
310364e0c2ca960648c12894f7e6a5588c2bc5391c98ec90e0f7a830e6802831 | MATLAB | 1,732 | 43 | % mglGetGammaTable.m
%
% $Id$
% usage: mglGetGammaTable(fullTable)
% by: justin gardner
% date: 05/27/06
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: returns what the gamma table is set to.
%
% t = mglGetGammaTable
%
% If the ... |
6b89c2a1c15b82fe303bec67115b8cb26d1035910f09cfb26ecce089cee986c7 | MATLAB | 1,733 | 55 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This is the main script (for calcium) to compute the data tables we need to perform the
% further analysis.
close all
clear all
clc
run('../figure_scripts/load_figure_config.m')
addpath(genpath('.'));
tstart = tic;
dateTag = ... |
51e921bf6faddfa6d73a84b05e785578dff606aa1f4c314f55fa2a3c7b8bd34e | MATLAB | 1,734 | 69 | function [pnt, tri] = icosahedron()
% ICOSAHEDRON creates an icosahedron
%
% [pnt, tri] = icosahedron
% creates an icosahedron with 12 vertices and 20 triangles
%
% See also OCTAHEDRON, ICOSAHEDRON42, ICOSAHEDRON162, ICOSAHEDRON642, ICOSAHEDRON2562
% Copyright (C) 2002, Robert Oostenveld
%
% This file is part of Fie... |
40612ec055bc9d83c1ffbfffe1f3c546fa0e93dc9cbe1cd41f06eee63f674265 | MATLAB | 1,735 | 40 | function [ns_RESULT, Data] = ns_GetNeuralData(hFile, EntityID, StartIndex, IndexCount);
%ns_GetNeuralData Retrieves neural event data by index
%
% Usage:
% [ns_RESULT, Data] =
% ns_GetNeuralData(hFile, EntityID, StartIndex, IndexCount)
%
% Description:
% Returns an array of timestamps f... |
422fda7e4130a21a11e542431043f9f1583e2889b0cb213db390b23197f8fb2d | MATLAB | 1,735 | 41 | function mltp_nvt_split_into_slice_nvt(obj, session)
if obj.isVerbose()
fprintf('Splitting NVT file data into separate slice_#_nvt.mat files.\n');
end
% Load the nvt file and split it into slices
slicesData = ml_nlx_nvt_split_into_slices( fullfile(session.getSessionDirectory(), obj.Experiment.ge... |
9eb54436d64b1267839e6de422ccd8e11de52a893602bf4c49ca9953bfdb28a7 | MATLAB | 1,735 | 1 | function params = displayParams
%
% % CODE TO SAVE GAMMA TABLE
% % load in a measurement made by Akshay using mgl on Aug 31, 2020.
% load('0012_oban_200831.mat')
%
%
% % use gammaTable 1, which is the powerlaw fit to the measurements
% % replicate to 256 x 3 for RGB (assuming 8 bits)
% gamma = calib.table*[1 1 1];
%... |
225e3b856153878ba25bebde8956a7e11b7ff0d576a21ebaae06afeb3604e46a | MATLAB | 1,736 | 64 | classdef Connectome
% CONNECTOME class
% stores a connectome and return matrix or vector (upper triangular) representation
% 22-08-2022 Jonathan Wirsich
properties
vec
%this should be probably an atlas object
regions
end
methods
% overload constructor: @par... |
3a6e15983a6d164c84557c45fc518c715b3bbbf0eed0755215dfeb657f614354 | MATLAB | 1,737 | 38 | function y = comm( op, port, data)
%COMM -- Serial port interface (a MEX file)
% COMM( 'open', PORT, CONFIG ) opens comm port number PORT for reading and
% writing. The CONFIG string specifies the basic serial port (baud rate,
% parity, #data bits, #stop bits) in standard DOS format. CONFIG defaults
% to '... |
2e3a25ae829c0b55cc9bc1797f532e36296718176a17ff4c413d568530465ff7 | MATLAB | 1,738 | 63 | function [eyevelOut, omitCenters, rawThres] = desaccadeVelNew(eyevelIn, presaccade, postsaccade, stdThresh)
% define minimum cutoff
% this is a safeguard for traces that have no saccades
minThresh = 13000;
% Smooth
%eyevelIn = smooth(eyevelIn,30);
%eyevelIn = smoothdata(eyevelIn, 'movmean', 10);
% Center the mean
velM... |
7b94713cf157e1f0197a328d144d0a53ff0928ba6239cb72d439a32e603799bb | MATLAB | 1,738 | 37 | % SONGETMARKDATA returns the timings and marker values for a Marker, AdcMark,
% RealMark or TextMark channel
%
% Implemented through SONGetMarkData.dll
%
% [npoints, times, markers]=
% SONGETMARKDATA(fh, chan, maxpoints, stime, etime{, filtermask})
%
% INPUTS: FH = file handle
% ... |
14fad8dc1ba7184d69e3bcac4b77c93e5df9bb6e6d19231b25fb5e3cc5971946 | MATLAB | 1,739 | 45 | % getLegReversals_1Leg.m
%
% Helper function for getLegReversals() and interactGetLegReversals(), to
% extract leg reversals for one leg. Replacement for findLegReversals().
% Uses MATLAB's findpeaks() instead of custom-written leg reversal finding
%
% INPUTS:
% legXPos - column vector of single leg's X position
% ... |
72797b8de862178e0389d2dea4bce50c891a867bcc2a1be320c65110ef9d077f | MATLAB | 1,739 | 56 | % Function File: yf = lpfilter (y, t, Fc)
%
% Low-pass filter y-values at the specified -3 dB filter cut-off (Fc)
% using binomial filters.
%
% Output vector is the low-pass filtered y-values.
%
% This function uses the smoothing algorithm in 'binomialf.m'.
%
% Bibliography:
% Marc... |
b5233fe96ba136367ad9e52c201721e85977b8150444a089660d5acaa2377260 | MATLAB | 1,742 | 57 | function [textureHist blobSizes] = BlobStructTextureHistBetterEdges(blobIndIm, colourIm, tBin)
% Create histogram
%
% Unlike evenly spaced bins, does evenly filled bins (on everage, each bin
% has the same number of members)
if ~exist('tBin', 'var')
tBin = 10;
end
% Get oriented gradients for each colour space
o... |
3303045f1fdf2bb7782a95f56d0c9cda1b273137d3aec24ee3a17e254b7985e9 | MATLAB | 1,743 | 50 | function map_norm = saliencyFilter(featsp, imsegs, im_lab, reg_sal)
[row, col, dim] = size(im_lab);
spnum = imsegs.nseg;
superpixels = imsegs.segimage;
adjloop = imsegs.adjmat;
column_lab = reshape(im_lab, row*col, dim);
pixel_sal = zeros(row, col);
k1 = 1/5; k2 = 1/100;
for i = 1:spnum
neighbor = fin... |
aad61f896f2f15d95544bd183728b88537fd8d5b2ab762daa730bba3221b425e | MATLAB | 1,743 | 51 | function handle = ternary_shift_XY( handle, axis_name, object, shift )
% ternary_shift_XY Shift ternary objects in groups along cartesian coord.
%
% Ternary handle is used to find objects to shift along "name" axis.
% Object is a string that identifies the object set (i.e."outline" "grid"
% "tick" "name") to b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.