sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
36e14166fff3b4fe8d39da78a30f24e7130ce1531bc972ad2f49d446ef2f561e | MATLAB | 2,750 | 88 | function mytitle = textOnFig_chnlInfo(params, plotInfo)
% returns text (string) of channel info
% placed on top of figure
% (c) Jiri, Jun20
if ~isfield(plotInfo, 'channel')
H_ch = struct;
else
H_ch = plotInfo.channel;
end
%% defaults
if ~isfield(H_ch, 'neurologyLabel')
H_ch.neurologyLabel = 'n.a.';
end... |
09628dc9bf8715ddb16e6893e12ff740ddce745729a02cc5b141a2a18436cfc4 | MATLAB | 2,751 | 70 | function java_dnd(jObj, dropFcn)
% Set Matlab dropFcn for java object, like JavaFrame or JTextField.
% 170421 Xiangrui Li adapted from dndcontrol class by Maarten van der Seijs:
% https://www.mathworks.com/matlabcentral/fileexchange/53511
% Required: MLDropTarget.class under the same folder
if ~exist('MLDropTarget',... |
a7174b9652465df82383f0d293c58b690936836df78213bf27d6cef52b0dfb75 | MATLAB | 2,751 | 111 | function [ITIOpt, ITIMdl, Kappa, RPE, Belief, Alphas] =...
GenerateLatencyData_AlphaPHModel(params, ratTrial,...
gen_arg, noise_arg, noise_params)
%GenerateSynthData_BeliefState Generates wait times for belief state model
%% Pull Parameters
H0 = 1/40;
alpha0 = params(1); % model-free learning rate
D = params(... |
ac22ecfbaee09a837d45c66785e1e380d627c1aeefa51c897a651629100703d2 | MATLAB | 2,751 | 80 | function hColorbarAxes = tapas_uniqc_add_colorbars(hax, imageColorMaps, imageRanges, ...
imageNames)
% Creates Colorbars next to image aixs for all given colormaps/value ranges
%
% NOTE: The plotted colorbars are actual normal axes with plots, NOT of
% class colorbar
% output = tapas_uniqc_add_colorbars(inp... |
f6a4e524bd4e79938e8d28d39a155e749f0bcb2a0eb89651762286d74d40d0e0 | MATLAB | 2,751 | 100 | function plotVEAll(outputs, field, inverty)
% Colormap
proxcol = [215, 15, 175]/255;
distcol = [255, 160, 25]/255;
% Figure
fig;
hold on;
hA = gca;
axis off
% Params
lw = 0.5;
bxw = 0.25;
alpha = 1;
spacing = [1,1.75];
buff = 2.5;
axlocs = [spacing; spacing + buff; spacing + buff*2; spacing + buff*3; spacing + buff*... |
0657c52130602d5b50414ef509f32bbbf983cd3ef0af315ee32d4d129bbf34dc | MATLAB | 2,752 | 71 | % PLUGIN_SEARCH - support function for plugin_menu
% Copyright (C) 2019 Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditi... |
48b6f511a7ec426d98bd5e66accc49c0a7a9733cef50b5e94ef301c33ce78c4d | MATLAB | 2,752 | 106 | function coactPaper_tableS06()
close all
fontsize=7;
fh=initFig('width',18.6,'height',1.8,'font','Arial','fontsize',fontsize);
x=1,y=1;
panel_01(x,y,fontsize)
drawnow()
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS06_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','-r300')
end
function panel_01(... |
fe4cf8f5aad84e071be23438356ded22b03c607e7ecb1cdcf2d5a324567fdaf3 | MATLAB | 2,752 | 66 | function out = MD_pNN(x)
% MD_pNN pNNx measures of heart rate variability.
%
% Applies pNNx measures to time series assumed to represent sequences of
% consecutive RR intervals measured in milliseconds.
%
% cf. "The pNNx files: re-examining a widely used heart rate variability
% measure", J.E. Mietus et al... |
0f001e336600153149b722a325e2ffdae00427ea0bab306ab139aea24b042690 | MATLAB | 2,753 | 93 | function fear_getIcaCoactTimeCondHighThreshold(basename,varargin)
% clear
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
% basename='~/data/Fear/triple/achel180320/achel180320';
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.Sessi... |
7c94fecf537e302101e68bbfc06874ac2941221b0791737abf0c2a573087f87b | MATLAB | 2,753 | 92 | function target = DBMerge(source,target,varargin)
%DBMerge - Merge databases.
%
% USAGE
%
% target = DBMerge(source,target,<options>)
%
% source database where the data is read
% target database where the data is added
%
% NOTE
%
% This function cannot handle overlapping databases.
%
% S... |
f46417320a96d0b7f0aefc5dd978536caa15e59753dc1c31f1f5039ef198b482 | MATLAB | 2,754 | 64 | function se=strel3d(sesize)
% function se=STREL3D(sesize)
%
% STREL3D creates a 3D sphere as a structuring element. Three-dimensional
% structuring elements are much better for morphological reconstruction and
% operations of 3D datasets. Otherwise the traditional MATLAB "strel"
% function will only operate on a slic... |
5daa6a5e456a759e60ff88df3fb007b0c32ea591eea235f43cab3ba16365c080 | MATLAB | 2,755 | 84 | %% h = sepia_handle_panel_Utility(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structu... |
9c946dbe680441c26a39b37994ac2820b27bb4c66917d5c9fef2dda4931520c6 | MATLAB | 2,757 | 70 | function [firstCrossing, pointOfCrossing] = BF_PointOfCrossing(x,threshold)
% BF_PointOfCrossing Linearly interpolate to the point of crossing a threshold
%
%---INPUT:
% x, a vector
% threshold, a threshold x crosses.
%
%---OUTPUTS:
% firstCrossing, the first discrete value after which a crossing event has occurred
% ... |
4704297aae40e2b96466e8586e7ba1577e95a034c7ccff705a8ffd8780db78f7 | MATLAB | 2,758 | 96 | function [ gta_metrics ] = nmri_calculate_gta( full_metrics, opt)
% [ gta_metrics ] = nmri_calculate_gta( full_metrics, opt)
% Will calculate GTA metrics (using BCT functions)
% allows normalization by permutating
%
%
% full_metrics = cell array of metrics, e.g. from nmri_export_metrics
%
%
% opt ... |
067c515a49c9a63d01208763b38fb590e7b7adf943b6a85ee0d088eb5f6bfd24 | MATLAB | 2,760 | 79 | % op_lorentz_linbas.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% y=op_lorentz_linbas(pars,ppm);
%
% DESCRIPTION:
% Generate a parametrized lorentzian peak with a linearly sloping baseline.
% This function is fed into fitting tools to enable fitting of peaks using
% lorentzian lineshapes.
%
% INPUTS:
% pars... |
7627dd39e57aa004bbcb65d2ecc9061371b15d3e56dd2c002a251ad603c238a5 | MATLAB | 2,760 | 60 | function vers = eegplugin_iclabel( fig, try_strings, catch_strings )
%EEGLABPLUGIN_ICLABEL EEGLAB plugin for EEG IC labeling
% Label independent components using ICLabel. Go to
% https://sccn.ucsd.edu/wiki/ICLabel for a tutorial on this plug-in. Go
% to labeling.ucsd.edu/tutorial/about for more information. To re... |
022e756d9ece0fc19ec9708b64f01bb1a206d8eb3c55c998697d971056fa28fe | MATLAB | 2,761 | 97 | function M = shapefitfactory(VJt)
% Linear manifold structure for optimization over the ShapeFit search space
%
% function M = shapefitfactory(VJt)
%
% Input: VJt is a matrix of size dxn, such that VJt * ones(n, 1) = 0.
%
% Returns M, a structure describing the Euclidean space of d-by-n matrices
% equipped with the sta... |
548acab04724d5b650f2e8c45130f4846110e60d3795f46f6cbbfab55f9d201f | MATLAB | 2,762 | 61 | %% sepia_configuration_QSM
%
% Description: a script contains all the QSM method names and related function names
%
% Kwok-shing Chan @ DCCN
% k.chan@donders.ru.nl
% Date created: 11 March 2020
% Date modified:
%
% DO NOT change the variable name
% DO NOT change the order of the entities, add a new one at the end inst... |
59afd74d454b88c0ab2a86c14ab6df8a12342eafd044d1cf8d934fa475b85b61 | MATLAB | 2,766 | 112 | function [ITIOpt, ITIMdl, Kappa, RPE, Belief, Alphas] =...
GenerateLatencyData_DivNormModel(params, ratTrial,...
gen_arg, noise_arg, noise_params)
%GenerateSynthData_BeliefState Generates wait times for belief state model
%% Pull Parameters
H0 = 1/40;
alpha0 = params(1); % model-free learning rate
D = params(... |
ab01679be4d700ceaaa07fbbebcfc31b5b302b43e2037dc54c814dc0dac47e84 | MATLAB | 2,767 | 101 | %DAGNN.UNIFORMSCALINGGRIDGENERATOR Generate an iso-tropic scaling + translation
% grid for bilinear resampling.
% This layer maps 1 x 1 x 3 x N transformation parameters corresponding to
% the scale and translation y and x respectively, to 2 x Ho x Wo x N
% sampling grids compatible with dagnn.BlilinearSampler... |
af4ab4b7170129501008e90c9b4d2183e75be615da93f82c5365fa6ca8742160 | MATLAB | 2,767 | 64 | %% plot slices: test script
% - load header H
% - select iEEG channels
% - load brain volumes that are "fixed" (same for all channels of one subject, e.g. wT1.nii)
% -> brainVolumes_fixed.m
% - load brain volumes that are "channel-specific" (e.g., wDefault.nii)
% -> brainVolumes_chSpec.m
% - plot... |
ed4523a1f4b8e6cd4a3e1cbf5016b1545140a73d38cd0519fdd506313faf6b6b | MATLAB | 2,767 | 86 | function V = spm_write_vol(V,Y)
% Write an image volume to disk, setting scales and offsets as appropriate
% FORMAT V = spm_write_vol(V,Y)
% V (input) - a structure containing image volume information (see spm_vol)
% Y - a one, two or three dimensional matrix containing the image voxels
% V (output) - data st... |
f3532d32ab23fbcac89382f08f38b63aab5da3ce3fcd4d88fcf1bf204e8cb96d | MATLAB | 2,767 | 66 | %{
tuning.MonetCleanRF (computed) # RF maps with common components removed
-> tuning.MonetRFMap
---
clean_map : longblob #
%}
classdef MonetCleanRF < dj.Relvar & dj.AutoPopulate
properties
popRel = tuning.MonetRFMap % !!! update the populate relation
end
methods(Access=... |
1640ec51e2371630a08fbf7cea5a64beff469353c0cc80bd7ad387385ca038a4 | MATLAB | 2,768 | 78 | % STD_COMPPOL - inverse component polarity in a component cluster
%
% Usage: [compout pol] = std_comppol(compin);
%
% Inputs:
% compin - component scalp maps, one per column.
%
% Outputs:
% compout - component scalp maps some of them with inverted
% polarities, one per column.
% pol - logical... |
0f5bf359dea99731a8825b6a3346acda4a8e731e7449a633ba663dbe50956cb6 | MATLAB | 2,769 | 91 | function plot_fig3ab_latency(datadir)
% Plot latency to peak/trough in DA/ACh at offer cue (left) and reward cue (right).
% N = 10 DA rats, N = 10 ACh rats
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
region = 'dms';
[ms, ~] = run_getAvgFlatency(datadir, r... |
199d1beb89f098d94d507a71f9c49bb1d1b31d9e1c34b64f14d1d4112e1fc3f7 | MATLAB | 2,770 | 71 | function [CPM_results] = test_CPM(NBSPredict)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test_CPM gets structure from the test function originally written for
% NBSPredict and convert to a structure that can be used by CPM. This
% structure is then used by CPM and the outcome structur... |
8a3a018460ac387245832642e135ad57af97a0280cf18321ef942caba62b832f | MATLAB | 2,770 | 101 | %DAGNN.UNIFORMSCALINGGRIDGENERATOR Generate an iso-tropic scaling + translation
% grid for bilinear resampling.
% This layer maps 1 x 1 x 3 x N transformation parameters corresponding to
% the scale and translation y and x respectively, to 2 x Ho x Wo x N
% sampling grids compatible with dagnn.BlilinearSampler... |
b2270ca9bd6597b3c872594b132115d148ceeb40d14a275f5c24721db0cbf9b4 | MATLAB | 2,772 | 98 | %% This script contains the raw commands of the tutorial demo (tapas_hgfTB_demo.m) for the HGF toolbox
% ----------------------------------------------------------------------------------------------------
% Copyright (C) 2014 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released... |
bd08577d2e5ade0368488234a5595dc76aaec0663783895ef78cdf597b7b466b | MATLAB | 2,773 | 102 | %-------------------------------------------------------------------------------
% Function
%-------------------------------------------------------------------------------
function [XDL, XDR, pDelays] = cross_correlation(X, DL, DR, tTrialBeg, tTrialEnd)
% trial info
%tTrialBeg = -0.2;
%tTrialEnd = 1.7;
bCAT = 1; % co... |
c0156e90f558cf4a1a11e9ed38feeb602b39cd32894a39bb4ef1354c7df5fc61 | MATLAB | 2,773 | 84 | function [MRSCont] = osp_MRSIRecon(MRSCont)
%% [MRSCont] = osp_MRSIRecon(MRSCont)
% This function reads MRSI data.
%
% USAGE:
% [MRSCont] = osp_MRSIRecon(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data container.
%
% AUTHOR:
% ... |
e7d1aa09c38bb6180c188d3f570b0156c376fffd5c2592f2a7e24362e1dc51e3 | MATLAB | 2,773 | 75 | %{
monet.VonMises (computed) # directional tuning
-> monet.DriftResponseSet
-> pre.Spikes
-----
von_r2 : float # r-squared explaned by vonMises fit
von_pref : float # preferred directions
von_base : float # von mises base value
von_amp1 : float # amplitude of first peak
von_amp2 : float # amplitude... |
f16325fa200d1b815be1f411dc8b0756aed12a0979bfa37c77b0a54863affd5b | MATLAB | 2,773 | 75 | function createBatchCSVFile(raw_file_dir, batch_csv_fname, autofill_div, autofill_genotype, genotype)
% Create batch .csv file containing information
% (recording filenames, DIVs, genotypes, and ground electrodes).
% Function written by DO, Nov 2023
% Overall aim of this script is to assist the functio... |
291a9bf6d8a29a29b888a1c69f1e734e9cd9832cd845184c8b1e009217ff561a | MATLAB | 2,775 | 73 | function osp_onLeftBasis( ~, ~ ,gui)
%% osp_onLeftX
% Callback function on process click on left x voxel direction button.
%
%
% USAGE:
% osp_onLeftX( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written ... |
edf41209ecf87d512c5c96b63c48c26920b9f19063f59db4e1a842fc9abbc85d | MATLAB | 2,776 | 83 | function [ all_metrics, all_layouts, all_subjects ] = nmri_load_metrics_sensor( all_subjects, metric_txt, freq, params )
% [ all_metrics, all_suma, all_subjects ] = nmri_load_metrics_sensor( all_subjects, metric_txt, freq, params )
% will load a specific connectivity netric (or power/normalized power)
% for a speci... |
193457a9290a87f07407ca6d3a1dbcaa000acf035953175d2abc7adb4a9d6521 | MATLAB | 2,778 | 98 | function fear_shockTrigReact(basename,varargin)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
% basename='~/data/Fear/triple/booyah180430/booyah180430';
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
param.binSi... |
402427614eec716d54939275959d589a9d55229d8b3a978827f6406ce27d15de | MATLAB | 2,778 | 90 | function [fit,cfg] = Zhang_fit2(data,cfg)
% [fit,cfg] = Zhang_fit2(data,cfg)
%
% fit maximum-likelihood mixture model as described
% by Zhang & Luck, Nature 2008
if nargin < 2
cfg = struct;
end
if ~isfield(cfg,'fitmean')
cfg.fitmean = false;
end
if ~isfield(cfg,'offset')
... |
d1ff2ae456e83c213e700f12a783097a5b508102085dd4239c91f2dd3cb3cef1 | MATLAB | 2,778 | 82 | function pipelineSaveFig(figName, figExts, fullSVG, figHandle, renderer)
%
% Saves figure with the provided figure extensions
%
% Parameters
% ----------
% figName : str
% figure name without extension, provide the full path if needed,
% otherwise the figure will be saved to the current folder
% figExts : ce... |
d84a75c5764cf7fc28758a982ea7312a5e0a1d83c9fa364556e38b2186da310f | MATLAB | 2,778 | 69 | function [estradiol, RatConc, RatGroups, groups, m_mean, d_mean,...
ep_mean, lp_mean, e_mean, m_err, d_err, ep_err, lp_err, e_err] =...
serum_osmolality_estradiol(Outlier_factor, SerumOsmolalityTable,...
EstradiolExp1Table, EstradiolExp2Table)
groups = {'male','diestrus','earlyproestrus','lateproestrus','e... |
e11a19fa71ad62328de2830796a504715bb3df382fdf32c594cfeed73130c112 | MATLAB | 2,778 | 87 | function Test_trustregions
% We attempt to compute an intrinsic mean of subspaces, that is, of
% points on the Grassmann manifold. Let there be m subspaces of
% dimension p embedded in R^n. We generate random data for our tests:
% X is a random nxpxm matrix such that each slice of size nxp is an
... |
f564efcd52d8970472808c9a19f2821ee5f7fdd6abfd7d2e4818a00846627ef1 | MATLAB | 2,778 | 86 | %{
map.AreaBorder (imported) # clips from movies
-> map.OptImageBar
---
max_reversal : mediumblob # full file name
fixed_map : mediumblob # improved phase map
border : mediumblob # estimated area border
V1_mask : ... |
8bf479acd54bf425bc8044cb8eabc96573107b73f7197e5a6c7820085277c47e | MATLAB | 2,779 | 88 | function results = confidence_volume(x,varargin)
% function results = confidence_volume(x,color [opt])
% x is 3-column [x y z] matrix of coordinates
% plots if color argument is specified
%
% Tor Wager and Robert Welsh, 10/15/01
%
% Modified by Tor Wager, 11/16/02
% to use the method of Johnson & Wichern,
% Applied ... |
16568926fd96e0906babc920d33a797ba561602721c61b33e3eaa29ac66fd481 | MATLAB | 2,780 | 77 | function [varargout] = constructModelRDMs(rawModels, userOptions)
%
% constructModelRDMs is a function which parses the User/modelRDMs.m file and
% saves a struct which is readable by the body other toolbox functions.
%
% [RDMs =] constructModelRDMs(rawModels, userOptions)
%
% rawModels --- Naturally specified... |
397fd581165d3c3c04a26155b77217e708aaf474ddd7048d7014ff425643fa27 | MATLAB | 2,780 | 69 | %% Simple 2-D movie
eeglab; close; % add path
eeglabp = fileparts(which('eeglab.m'));
EEG = pop_loadset(fullfile(eeglabp, 'sample_data', 'eeglab_data_epochs_ica.set'));
% Above, convert latencies in ms to data point indices
pnts1 = round(eeg_lat2point(-100/1000, 1, EEG.srate, [EEG.xmin EEG.xmax]));
pnts2 = round(eeg_l... |
74a15c7dfb1e8aebafc99d2c3196914dcf88f9d28a232f13a74b0324d285c104 | MATLAB | 2,780 | 112 | % (C) Copyright 2020 Agah Karakuzu
% (C) Copyright 2019 CPP visual motion localizer developers
function initEnv
% 1 - Check if version requirements
% are satisfied and the packages are
% are installed/loaded:
% Octave > 4
% - image
% - optim
% - struct
% - stat... |
adfe5b649d463f227f78168653dc2c38c9e21e349d2d6e9b51e370c64c8d6dc0 | MATLAB | 2,780 | 82 | %% Create Dataset
function [ALA_visible, ref_all, vals_all] = FD_clVAE_CreateFGSDataset(data_path)
%% Load Data, ref 4,5,6,7,9
ref1 = imread(fullfile(data_path, 'P007 (1).png'));
ref2 = imread(fullfile(data_path, 'P007 (2).png'));
ref3 = imread(fullfile(data_path, 'P008 (2).png'));
ref4 = imread(fullfile(da... |
8c8b5f5c0c7e53e217004fcfb6d3851443f62ef3c68ededf66b817d8f8550241 | MATLAB | 2,781 | 68 | function [Cxy, F, T, ICxy] = COH_v2(signal, time, labels, setting)
% Function computes coherence and im. coherence.
% INPUTS===================================================================
% signal... EEG (time X channel X trials)
% time... time vector in seconds (time X 1 X 1)
% labels... (1 x trials) defines trial... |
25e3160aa1389fb92b6e6a9cede4430508dd357a89a1b72efb0f154102e9350a | MATLAB | 2,782 | 117 | function [con,NLCON] = cluster_indiview(cl,EXPT)
% function [con,NLCON] = cluster_indiview(cl,EXPT or con img list or con image data)
%
% tor wager
% used in button-up fcn callback
global VOL
global con
global f
global f2
global NLCON
% -------------------------------------------------------------------
% ... |
42b0ffc0389ed5a63e1399ffef981a7a8f79bfd8273025f1f0d5172358064908 | MATLAB | 2,782 | 103 | function M = euclideanfactory(m, n)
% Returns a manifold struct to optimize over real matrices.
%
% function M = euclideanfactory(m)
% function M = euclideanfactory(m, n)
% function M = euclideanfactory([n1, n2, ...])
%
% Returns M, a structure describing the Euclidean space of real matrices,
% equipped with the standa... |
56b663344f53b40d54e62fa1b1b68c580fa6a66a9b7a182890a4ca29f43b1fb9 | MATLAB | 2,783 | 77 | %{
# Bad movie clips
-> stimulus.MovieClip
---
judge : enum('human','machine') # was it a man or a machine?
notes : varchar(256) # a little explanation for the exclusion
%}
classdef ClipIgnore < dj.Manual
methods
function inspectClip(obj, restrict_key, fps)
... |
ddf28bd2694889d7b3489694da243b40425698fc493895301f8d8a92e850e634 | MATLAB | 2,784 | 126 | function [cl,anyStudy,studyByCluster,SOMResults,theData,whSOM] = Meta_SOM(P,nGrid,theData)
% [cl,anyStudy,studyByCluster,SOMResults,theData,whSOM] = Meta_SOM(P,nGrid,[theData],[mask name])
%
% test for meta-analysis data.
% tor wager modified this from Robert Welsh's som_test_01.m
%
% [cl,anyStudy,studyByCluster,SOMRes... |
0f2356de2c3810e7830ecc3f48dddd6786e36eb1350ef1e028e077b79bad598e | MATLAB | 2,785 | 57 | % pop_validatebids() - Validate BIDS dataset. Validation result will be
% printed on command window
% Adopting Openneuro's command-line bids-validator
% https://github.com/bids-standard/bids-validator
%
% Usage:
% >> pop_validatebids(); % open new window ... |
7ae218d067c82d7bcd37acec1cbccbe9bac59a31dc63e207ab865424310737ba | MATLAB | 2,785 | 72 | %% Load data
data_path = 'Y:\Alice\0012_NeuroGI\NeuroGI_ephys_data\2024-11_all_ex-vivo_experiments\20241115_ExVivo-08\';
load([data_path '20241115_C57female.mat'], 'data__chan_1_rec_2')
load([data_path 'datafile0017.mat'], 'data')
%% Preprocess data
% The endoscope channel matching closest the suction pipett... |
7497755c07768d73fe701ddbf18900b30fd5930c745c5f3dfcd626dfef298776 | MATLAB | 2,786 | 66 | function osp_onSeg( ~, ~ ,gui)
%% osp_onSeg
% Callback function on segment button click.
%
%
% USAGE:
% osp_onSeg( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into the
% gui class
%... |
b3ba272543de516083c23ff6cd2dc67027f4aef97b9c0c6aa30565b2c9f5284e | MATLAB | 2,786 | 71 | function out = DN_WithinP(x, p, meanOrMedian)
% DN_WithinP Proportion of data points within p standard deviations of the mean.
%
% ---INPUTS:
% x, the input data vector
% p, the number (proportion) of standard deviations.
% meanOrMedian, whether to use units of 'mean' and standard deviation, or median
% ... |
13dcf8cb7ea21bc675b0b2565cecdf46d16fec5570a07ee2dd340d15aedaf541 | MATLAB | 2,787 | 77 | % Peter Rupprecht 02-2015 using Scanimage B data
% reads metadata and returns image info file and framerate, zstep,
% framerate, zoom, motorpositions, scalingfactors
% optional input is the -full- filename/path
function [A,result,framerate,zstep,zoom,motorpositions,scalingfactors] = read_metadata_function(filename)
if... |
99bb3f33bb232a033c9ee3ccec5b2592db8a77553f9535bc7e21c7f2f23894fa | MATLAB | 2,787 | 83 | function [column_names] = tapas_physio_guess_regressor_names(model, R)
%tapas_physio_guess_regressor_names | Reconstructs missing names
% Given a physio.model structure returns a best guess for the names of
% the regressors. Useful for backwards compatibility for versions less
% than v7.3.0.
%
% INPUT:
% model ... |
c67e360a58816d4806136241b73651ea5cdbb9403a541237bb5f0ccb3943d671 | MATLAB | 2,788 | 66 | function [xClip, lutCmap] = relaxationColorMap(maptype, x, loLev, upLev)
% [xClip, lutCmap] = relaxationColorMap(maptype, x, loLev, upLev)
%
% RelaxationColorMap: acts in two ways:
% 1. generate a colormap to be used on display, given image type
% (which must be one of
% "T1","R1","T2","T2*","R2","R2*","... |
61fb5bd8459cdbefb8538681c3ae3d2574c4acf17568f64ed2283eb58fbdba65 | MATLAB | 2,791 | 80 | function task_gaitERP(sii, PATH, cfg)
% Calculate gait ERP of processed data stored at PATH.fieldName this is
% required for clustering (clean_c and clean_d)
% with artifact attenuated single subject EEG datasets stored as file_in at PATHIN
%
% INPUT
% - sii: vector of subject IDs to be processed
% - PATH: st... |
8a2593d5b42c6625a4955782b21c0d89ff2640f831c965da617f512a895d2c5c | MATLAB | 2,794 | 87 | function ADimInfo = get_affine_matrix(this)
% Computes an affine transformation matrix based on the resolution and the
% first sampling point.
%
% Y = MrDimInfo()
% ADimInfo = Y.get_affine_matrix()
%
% Note: The brackets after get_affine_matrix are necessary to prevent an
% error in numArgumentsFromSubscript us... |
9848850d31b579027823c7648a0b7f05011eeb8f27b8427dcf707042d177837b | MATLAB | 2,794 | 69 | % (C) Copyright 2020 CPP visual motion localizer developpers
function varargout = preTrialSetup(varargin)
% varargout = postInitializatinSetup(varargin)
% generic function to prepare some structure before each trial
[cfg, iBlock, iEvent] = deal(varargin{:});
% set direction, speed of that event and ... |
a260b5bbc559b5046a10a8c4f642d69ebba5b7d75b3d572662057b2942dd59af | MATLAB | 2,794 | 100 | function [fnOut, args] = tapas_uniqc_save_fig(varargin)
%save figure with current name as filename (with some removal of bad
%characters for saving
%
% fnOut = tapas_uniqc_save_fig(fh, type, pathSave, fn, res)
%
% IN
% varargin: property name / value pairs for extra options
%
% fh figure handle (default... |
83dbf5a61a4bd13f971aaf84f3944ef7c1589ae2c94b9965941bd65b1a1b108d | MATLAB | 2,795 | 100 | function plotHist(params, histData)
% plots histogram distribution of 'histData'
% histData = 2D: samples x chnls (may inlcude NaNs)
% (c) Jiri, Aug16
%% load 'H'
load(params.storage.cacheFile, 'H');
nCh = size(histData,2);
nBins = round(size(histData,1)/100);
% channel names
params.nCh = size(histData,2);
chNames =... |
f936331b3dd6fc3e7e5e97a91293616c49c9c261b1ae6cd1a6a18b7c68863396 | MATLAB | 2,795 | 94 | function [err, slc] = GetAfniSliceTriplet (Brik, BrikInfo, DM, Opt)
%
% [err, slc] = GetAfniSliceTriplet (Brik, BrikInfo, DM, Opt)
%
%Purpose:
% Get the slices to display as they appear in the AFNI window
%
%
%Input Parameters:
% Brik: is a vector or a matrix containing the brik values
% BrikInfo is a structure... |
9eca1a858d05fb70e7019c7b58df5795481b14b66d8fe73585153438bdae2839 | MATLAB | 2,796 | 76 | function ratio = FiringRatio(spikes,opt)
%FiringRatio - Compute ratio of active units of a population over time.
%
% Compute instantaneous number of firing units over the total number of
% units in a population.
%
% USAGE
%
% ratio = FiringRatio(spikes,<options>)
%
% spikes spike train, each row is [spi... |
abea65dc10b7f0b7c68aaa960d4c6caf4de5d88574e6c6ebec4287fbd0c2624b | MATLAB | 2,796 | 74 | function matlabbatch = get_matlabbatch(this, module, varargin)
% Returns matlabbatch to perform spm-processing with an MrSeries.
% Fills out all necessary file parameters and options for different
% modules, e.g. specification of the first level design
%
% matlabbatch = get_matlabbatch(MrSeries, module, varargin)
%
% T... |
49867c64e7876aba9fd7f25dc42fe04b3843dabbe6d2036e1fe18464b1e57407 | MATLAB | 2,797 | 64 | function phiFaceAverage = arithmeticMeanTensor(phi)
% This function gets the value of the field variable phi defined
% over the MeshStructure and calculates the arithmetic average on
% the cell faces, for a uniform mesh.
%
% Author: Aina Frau-Pascual, adapting code from arithmeticMean.m
% for its use with tensors
% e... |
de033d27d9cb57e9540fb430109b10cc94de09149578150ec921ce61ed175a13 | MATLAB | 2,797 | 102 | close all
clear all
clc
% simulate 10 x 10 box
global gridscale
gridscale = 8;
x = linspace(0, 19.9, 200) ;
y = x ;
[X,Y] = meshgrid(x,y) ;
r0 = pi/2;
shiftx_0_1 = 1;
shifty_0_1 = 0;
r1 = pi/6;
shiftx_0_2 = 1;
shifty_0_2 = 1;
shift_xy = zeros(2, 1);
n_cells = 40*40;
shift_vec = linspace(0, 2*pi- 2*pi/sqrt(n_ce... |
7e6ad014086da84df9df15c964eeb4b19ee0e4b0eb78b36c47b9295eb82655d6 | MATLAB | 2,798 | 99 | function M = euclideancomplexfactory(m, n)
% Returns a manifold struct to optimize over complex matrices.
%
% function M = euclideancomplexfactory(m)
% function M = euclideancomplexfactory(m, n)
% function M = euclideancomplexfactory([n1, n2, ...])
%
% Returns M, a structure describing the vector space of complex matri... |
d763a1d8134486e85345c6eb8cb6e1cc39962afa6465bdbbac3287492353b22a | MATLAB | 2,798 | 74 | function stopfun = stopifdeletedfile(filename)
% Create an interactive stopping criterion based on the existence of a file
%
% function stopfun = stopifdeletedfile()
% function stopfun = stopifdeletedfile(filename)
%
% Use on the options structure passed to a Manopt solver, e.g.:
%
% problem = ... % manopt problem st... |
0d7b917e102b45f5139d54c35deda841fd788a0004cabebe70abc5d0a11908bc | MATLAB | 2,800 | 67 | %{
# Objects extracted from movies used for generating clips and stills
->stimulus.Movie
---
path : varchar(255) #
original_file : varchar(255) #
file_template : varchar(255) # filename template with full path
%}
clas... |
50187b4a220a1a98cb6fa575b5d2af8d212610c78954759a3dad1015f11ddc60 | MATLAB | 2,800 | 134 | function movie_in = denoising(movie_in, options)
% update the movie in place to save the memory
windowsize = options.windowsize;
[m,n,p]=size(movie_in);
startno = [1:windowsize:p];
tau = 0.015;
lambda =20/sqrt(m*n);
rank = 10;
meanI=mean(movie_in,3);
tic;
for i=1:numel(startno)
disp(['processing ' num2str(i) '... |
505f3985749894ddab69ed85f6d9a2fd610e952f9abcfc0325e2efadb4df4d59 | MATLAB | 2,800 | 76 | function varargout = biopac_acq(filename, hdr, begsample, endsample, chanindx)
% BIOPAC_ACQ is a wrapper to for the reading function from Mathworks file exchange.
%
% Use as
% hdr = biopac_acq(filename);
% dat = biopac_acq(filename, hdr, begsample, endsample, chanindx);
% evt = biopac_acq(filename, hdr);
%
% See... |
d92e761b13e718a3ee4b801887b900fb5558797c99ef8be88593ac40339c9970 | MATLAB | 2,800 | 73 | %--------------------------------------------------------------------------
% writeSparsePointsVTKFile.m script is used generate VTK file of sparse point lists
%
%% Developed and maintained by Kannan Umadevi Venkataraju <kannanuv@cshl.edu>
%% do not distribute without permission.
%
% Usage
% [labelMap pointLabels] = w... |
444c7c513cbbbd3d42fe25418deefbf34fd58aa9cf4df66e6abfcf8c87d2101a | MATLAB | 2,803 | 83 | function surf = SurfStatWriteSurf1_nonorm( filename, surf, ab );
%Writes coordinates and triangles to a single .obj or FreeSurfer file.
%
% Usage: surf = SurfStatWriteSurf1( filename, surf [,ab] );
%
% filename = .obj or FS file name. If extension=.obj, writes a .obj file
% (ASCII or binary), else write... |
4ba616fc680949d39456430052d4ad1e45fc66a4ef2ba52aae4b5e9eede92bee | MATLAB | 2,803 | 134 | function movie_in = denoising(movie_in, options)
% update the movie in place to save the memory
windowsize = options.windowsize;
[m,n,p]=size(movie_in);
startno = [1:windowsize:p];
tau = 0.015;
lambda =20/sqrt(m*n);
rank = 10;
meanI=mean(movie_in,3);
tic;
for i=1:numel(startno)
disp(['processing ' num2str(i) '... |
2c8193d189c56dd5a0d56f63969c99887569f55b8c343d3d1104390e6611c72c | MATLAB | 2,804 | 79 | dt=0.1;
ec_pv=linspace(0,40,21);
time_window=70; %ms
delta_t=round(time_window/dt);
for iter=1:6
iter_name=num2str(iter-1);
for k=1:21
input_ec=zeros(1,600000);
output_gc=zeros(1,600000);
bas_num=num2str(k-1);
file1=strcat('Ras_inh_gc',iter_name,bas_num);
file2... |
14d6c1bcd87ed8767fb339d13c989d9877f17795de8445e38096d85e106c2b59 | MATLAB | 2,806 | 91 | function [metadata,summary]=h5readmeta(fpath,varargin)
% HELP
% Reading all metadata from the h5 file while skiping the main dataspace with movie ('/mov' on defaults
% SYNTAX
%[metadata,summary]= h5readmeta(fpath) - use 2, etc.
%[metadata,summary]= h5readmeta(fpath,'optionName',optionValue,...) - passing options using ... |
3753d7aae9aaf501e9030f8333be3620ba70b299b7e9ec66e0c2ac77a8cb63b7 | MATLAB | 2,806 | 94 | function [datobs, datrnd] = cluster_test_helper(dat, nperm, diffstat)
% CLUSTER_TEST_HELPER is a helper function for doing cluster-corrected
% permutation tests in arbitrary dimensions. The randomizations are
% generated under the assumption that input dat was computed using a paired
% statistic T for which T(a,b) = -T... |
655506f04a28d25971b7fdbba648e4cf1a44e7f3066c28261c10cc8a73935b23 | MATLAB | 2,806 | 89 | function [CVresults] = crossValidation(fun,data,varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% crossValidation performs k-fold or leave-one-out cross validation on data
% provided to compute performance of given model.
%
% Arguments:
% fun = Objective function (e.g., estimat... |
e4e8360c3e5a1d254613215740bd664e905c44eb3387d987becb87e665bbd270 | MATLAB | 2,806 | 105 | function [err,v, typ] = BrikInfo_SectionValue (BRIKinfo, sSection)
%
% [err,s, typ] = BrikInfo_SectionValue (sHead, sSection)
%
%Purpose:
% Get the values of a section in the .HEAD string
% This function is dedicated for BrikInfo function
%
%Input Parameters:
% sHead, a string vector containing the .HEAD info
%... |
73c949a703451f6fe7dec3555594c386d1ed3fb291bbd051256f12b05033eeeb | MATLAB | 2,808 | 104 | %% [b0,b0dir,voxelSize,matrixSize,te,dte,CF]=SyntheticQSMHubHeader(nii,varargin)
%
% Input
% --------------
% nii : NIfTI matlab structure
% varargin (for user input)
% ---------
% 'b0' : field strength in tesla (default: 3)
% 'b0dir' : main magnetic field direction (default: based on quantern ... |
b5e67b7710b09591f5536b725d080bfe8aca9bb922ab2521a145c488b6048950 | MATLAB | 2,808 | 90 | function pos=surfing_inds2subs(siz, is)
% Multiple subscripts from linear indices; a generalization of IND2SUB
%
% P=SURFING_INDS2SUBS(SIZ,IS) returns the subscripts POS for each of the
% linear indices in IS based on a matrix with dimensions SIZ.
% If SIZ=[s1, ..., sn] refers to a matrix of size s1 x ... x sN, and I... |
e409f7f41ece22f34e269046a3300eee87d1467a577604b7f72036c5e6c09112 | MATLAB | 2,808 | 82 | function [value,freq,index] = uniquef(grp,sortflag)
% UNIQUEF: Given a matrix containing group labels, returns a vector containing
% a list of unique group labels, in the sequence found, and a
% vector of corresponding frequencies of each group.
% Optionally sorts the indices into ascending ... |
09cbcadcf070eb27fc9f35ed11258649dd97fa4e9d4a674db6f6c0c5c9c96f53 | MATLAB | 2,811 | 70 | %{
monet.OriDesign (computed) # design matrix
-> monet.DriftTrialSet
-> monet.CaKinetics
-----
ndirections : tinyint # number of directions
design_matrix : longblob # times x nConds
regressor_cov : longblob # regressor covariance matrix, nConds x nConds
%}
classdef OriDesign < dj.Relvar & dj.AutoPopula... |
29712851cc5c45e366a99542917caf542fed3700f95865956755b77b23cf2e23 | MATLAB | 2,811 | 66 | function loss = CostFunction(p_max_all, target_point,kgrid,sim_vol)
tmp = p_max_all;
mask_tissue = ones(size(sim_vol));
mask_tissue(sim_vol == 0) = 0;
mask_tissue(sim_vol == 1) = 0;
mask_tissue(sim_vol == 2) = 0;
p_max_all = p_max_all.*mask_tissue;
target_depth = 4e-2;
center_inds = [5,floor(kgrid.Ny/2), floor(kgrid.... |
d8f5e78a61f2869ff6594f5e7447c91cba4768e87eddf90476a5e0feb982312c | MATLAB | 2,811 | 87 | function plotTargetClassifierProj(output, field, plotCrosstimes)
% Plots projection traces like in Kaufman et al 2015 eLife
% time runs vertically
if nargin < 2
field = 'proj';
end
if nargin < 3
plotCrosstimes = 0;
end
% Figure
fig;
hold on;
axis off
% Plot traces
lw = 0.25;
scale = 1;
alpha = 0.35;
for mo... |
513fb9f592191d2d6f62e36a2c93aac268ef23882512b84db2c33800eec2225d | MATLAB | 2,812 | 67 | function paraTimes = getParadigmTimes(params)
% returns paradigm times defined in 'params.plot_triggering.paraTimes'
% selected trials in pred_prc(tr).wasSelected (see: getTriggers_..._timesLabels.m)
% paraTimes = mean over all selected trials
% paraTimes = 2D: [class labels x selected time points]
% (c) Jiri, Jun20
... |
808b449ac9ad085ceadd0fd293ec7dafc019fdecdba04dfdc0d29782cac393cb | MATLAB | 2,813 | 87 | % Script demo_constructor
% Shows versatile options for creating MrImage object
%
% demo_constructor
%
%
% See also
% Author: Saskia Bollmann & Lars Kasper
% Created: 2018-03-01
% Copyright (C) 2018 Institute for Biomedical Engineering
% University of Zurich and ETH Zurich
%
% This file is par... |
f40ad8747c30c8e7e9e765692616530640a3d97dfecb969390a81d4a81a38608 | MATLAB | 2,813 | 85 | function filterMatrix = createSpatialFilter(params, N_inputCh, filterSettings)
% creates a spatial filter for (intracranial) EEG data
% input vars:
% N_inputCh: number of input channels
% selCh: vector of selected channel indices
% filterSettings: struct, CAR, BIP, ...
% output var:
% filterMatrix: N_inputCh x ... |
1dd0cfd68bd122d0cb79685d4bfaefc6260f4abe3ae95be557a55fdfbb32569a | MATLAB | 2,814 | 76 | function out = SY_Trend(y)
% SY_Trend Quantifies various measures of trend in a time series.
%
% ---INPUT:
% y, the input time series.
%
% ---OUTPUTS:
% Linearly detrends the time series using detrend, and returns the ratio of
% standard deviations before and after the linear detrending. If a strong linear
% trend is ... |
8e6e5f78e2a7ae947c7947064ec017dec71bf33671108bca10a06b8f0599ab1c | MATLAB | 2,814 | 104 | function run_condutance_adni(subject)
% Compute conductance maps from tensors computed with DSIstudio
% Adapt paths and file names to your own!
%
% Example: run_global_connectivity_adni(003_S_2374)
%
% Author: Aina Frau-Pascual
%%% Load folders and code
% Add code folders to path
folder='Code/FVT4DWI';
addpath(genpa... |
a3d8b7280891547611c4bcd2a68423a18e48c32a81e3adabf1be034f6bddfe8b | MATLAB | 2,814 | 84 |
function [Convergence_curve,Ceq1_fit,Ceq1,Ceq_net,Ceq_tr]=EO(Particles_no,Max_iter,lb,ub,dim,fobj,data)
Ceq1=zeros(1,dim); Ceq1_fit=inf;
Ceq2=zeros(1,dim); Ceq2_fit=inf;
Ceq3=zeros(1,dim); Ceq3_fit=inf;
Ceq4=zeros(1,dim); Ceq4_fit=inf;
C=initialization_EO(Particles_no,dim,ub,lb);
Iter=0; V=... |
203562e30a3b5f9624f120bb559549921fec6a93b6cc41e34f65616402ac9022 | MATLAB | 2,815 | 75 | function [up,down] = ZeroCrossings(data,varargin)
%ZeroCrossings - Test zero crossings in a given time series.
%
% This assumes a minimum of 10 samples per positive/negative phase.
%
% USAGE
%
% [up,down] = ZeroCrossings(samples,<options>)
%
% samples the <a href="matlab:help samples">samples</a> to pro... |
b5dd7367cc412301e428832f09133e0b80fa971eb39ce6b72c3e28012b3feebe | MATLAB | 2,815 | 89 | % Test superposition property in conductance computation,
% in a 2D vector example
% Author: Aina Frau-Pascual
% Input image
im = zeros(3) + 0.0;
im(1, :) = 0.8;
im(:, 1) = 0.8;
im(:,:,2) = 1 - im(:,:,1);
im(im==1) = 0;
% Construct mesh structure
Lx = size(im, 1); % domain length
Nx = size(im, 1); % number of cells... |
b273a23521df24f4beef396ed3ea8dd39ec85403121ed1c02a814ea894ba87d5 | MATLAB | 2,817 | 73 | classdef MovieSpecs < handle
%MovieSpecs stores .h5 movie file universal content (besides the movie)
% and provides simple operations for history manipulations
properties (Constant = true)
history_sep = ';'; %separator of the history string
end
properties (SetAccess = protected)
... |
cf5f1b5469443882604845f6b7e855cef50fdc23d02e4f24f5ff391376691e34 | MATLAB | 2,817 | 99 | %% Computing entropy of sequences
[seq_ent,seq_maxent,dkl] = cellfun(@(x) compute_seq_ent(x),ens_seq_stim);
%% entropy of sequences of increasing word length
maxlen = 24;
minlen = 0;
[words,counts] = count_sequences(ens_seq_stim{1,4},minlen,maxlen);
[words_nz,counts_nz] = count_sequences(ens_seq_nz_stim{1,4},minlen,ma... |
56d8c24ba2109b0984908a6b094b608304564c68fed106953ae93779e5e41451 | MATLAB | 2,819 | 89 | function plotDotsWithTextLabels(coords_xy, localOptions)
% plots the set text labels in cell array 'textLabels' at the positions
% 'coords_xy' in the current plot in font size 'fontSize' in black (by
% default) or using category colors specified by optional further arguments
% 'categoryColumns', 'categoryColors', and ... |
7b24d7900dad3af3bbade5140d524c5029f38a77a0d89f3632e3b656f4b334e1 | MATLAB | 2,819 | 94 | function fear_getHfoPeakFreq(basename,varargin)
% load('~/data/Fear/triple/hoegaarden181115/hoegaarden181115.basicMetaData.mat')
% basename=basicMetaData.Basename;
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
load([basicMetaData.Basena... |
e005559af55da1ad1c4df9d6ee590be0dbff3b98a3d399c74358bac238ae0548 | MATLAB | 2,819 | 71 | function [] = show_NBSPredictProgress(NBSPredict,iter,scores)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% show_NBSPredictProgress prints progress of NBS-Predict algorithm on
% MATLAB console.
%
% Arguments:
% NBSPredict: NBSPredict structure in which parameters found.
% iter = Th... |
81dcd1e3263d4ab95ce84f65f8f7dbe4de13f968ed9c508babab16d7d181c735 | MATLAB | 2,820 | 106 | function FigureS6(datadir, codedir)
%FigureS6 - Satiety effects for trial initiation time are modest and do
% not qualitatively affect results
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'IgnoreCase... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.