sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
adfecc9d4f05c6794e943fc77f8eb4742e5446d8fe8374ae79a4d252ab9e3c80
MATLAB
1,881
50
function data = get_one_subject_data(subject, type_stimulation) %Navigate to the folder with the results current_folder = pwd; cd Data %% Variables of interest % p.stim_type %1: left tilt, 2: right tilt % p.speed_accuracy_trial %1: speed, 2: accuracy % p.cue_validity %0: invalid, 1: valid % p.cue_direction ...
0f17e6ec4ea671f9cc5501acf726c43f4c9f7fdca1747f0b59e270ff011af046
MATLAB
1,888
78
%% calculate the mean angle of the right most cluster cmap = parula(11+1); cmap = cmap .* repmat([.9 .8 .9],size(cmap,1),1); ic = 0; for thresh = 5:15 x = obs2obs(:); y = exe2obs(:); ind_min_rel = x>=thresh; x = x(ind_min_rel); y = y(ind_min_rel); % convert to angle ang...
57ee68acd47a4ecc1f61fa2e1f08e92623638caa4aae10e94f9cbcf8ae20e70a
MATLAB
1,890
60
function obj = createObjFromTree(s, g) %CREATEOBJFROMTREE creates an object from a tree-shaped struct % Arguments: % s - a tree-formed struct that serves as a template for object % construction % g - an optional struct with global parameters that belong to several % (sub-) objects. % % This function...
fbadaf65209e15e533f1d2b9d86ea80f4ed01b3a510a333414417ca56adeeb0b
MATLAB
1,893
58
% rsc = linmap(val,valMin,valMax,mapMin,mapMax) % --------------------------------------- % % Performs a linear mapping of val from the range [valMin,valMax] to the range [mapMin,mapMax] % % Inputs: % val Input value % valMin Minimum value of the range of val % valMax Maximum value of the range of val % m...
5e973d23f6b539b464fb50db0aaed94ea7fe03dbe36b0078f31d9002c4a67005
MATLAB
1,911
59
function [mdp_states, ts_stats] = ... align_state_times(snr_time, last_idx_before_skip, mdp_states, folder_log) n_mdp_states = height(mdp_states); msgs = {sprintf('n-mdp-state %d', n_mdp_states), ... sprintf('n-snr-state %d', length(snr_time))}; if ismember('strig', mdp_states.Properties.VariableNames) m...
45455a2f45078e72bf05e49b8e513efba56a345831b5518f0218c0b440580a83
MATLAB
1,917
39
clear; Totangles = []; %define vector for angle values across all data sets Totturns = []; %define vector for turn angle across all data sets NumTurns = []; %define vector for number of turns made by each neuri...
859c27f1a87f014b2b5cfcc2d9b058ff78890f5ff819b212e6c199a580b4f405
MATLAB
1,925
45
function process_NA_from_single_experiment_kilosort2(origin_dir, do_plot, do_print, do_close_all, is_new_layout, neural_mode) if nargin == 1 do_plot = true; do_print = true; do_close_all = false; end path_parts = split(origin_dir, '\'); if isunix() path_parts = split(o...
616a32646481e573d4d5f2e0ddb2011f413c746cec2001f4c89c84c648c6dfcb
MATLAB
1,927
81
function gramm_supFromAdapVsOcc_RESP(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); cle...
8c506604f099ea899a1c11cf0c1f5ee2ece1c7d2ad975fe666f0ff67136d2c83
MATLAB
1,931
68
%Author: Tatjana Schmitt, 2019-2022 function stats = find_center_of_mass(BF, varargin) % finds 1 or more centers of mass of chosen BF narginchk(1,4) if nargin >= 2; frequency_hub = varargin{1}; else; frequency_hub = 1; end if nargin >= 3; se = varargin{2}; else; se = strel('disk', 3); end if nargin >= 4; le...
a1373e7a0fc71a818fea60eabd043cf3aa738d0d920d0dce9d1749be735b61f5
MATLAB
1,940
39
load("timeseries.Yeo2011.mm316.mat"); output_dir = "full_data_linear_downsample"; mkdir(output_dir); count = 0; for m = 1:316 subject_mx645_original = subjects(m).mx645; subject_mx1400_original = subjects(m).mx1400; subject_std2500_original = subjects(m).std2500; [mx_645_rows, mx_645_columns] = size(sub...
bee9f12735592d0f31b9746d30f8e2589d5fb57a5227783c27f02f9543f4c3fa
MATLAB
1,942
67
%% % Simulation results for the non-spatial two populations model for networks % with and without astrocyte ensheathment of exc and inh synapses %% %% Figure 7A: Correlation surfaces across different values of p_en^i % load the data load('./CompressedData/NonspatialTwoPop/enEandIGridData_2Pop.mat') % probability of ...
69d4690a491cdc62f738088c1dd933b9daf7d8c7409d332dfd5c74f01cf54f25
MATLAB
1,943
81
% plotIndividualSessionsFromIDX clear close all PostSetup('BrockHome') flag_SaveFigs = true; %% Get IDX global IDXDIR cd(IDXDIR) if ~exist(strcat(IDXDIR,'\IDX_iScienceSubmission.mat'),'file') IDX_iScienceSubmission end load(strcat(IDXDIR,'\IDX_iScienceSubmission.mat')) %% Loop through IDX, to plot indiv...
48f4c4f7e4d61d4577411a95c3e1a2fb961d9784ab70087b607865ef83353b41
MATLAB
1,944
73
function gramm_dCOS(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear DataForVis cou...
e4c4830ae490eaac25fe4ae49ed72d77bdedbfd1d25465a9e240c9321c2bdca1
MATLAB
1,945
83
clear all close all clc addpath(genpath('./deconvtv_v1/')); %%%%%%%%%%%%%%%%%%%%%%%%%%%% % Example 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% %fname = 'DMSO1%.tif'; %z = read_hyperdata(fname); %y = z + 0.1*randn(size(z)); %sigma = estimate_noise_level(y); %w = estimate_w(sigma,size(y)); %mu ...
23cbcc9603a4347442251d674ad6945375172b0b708cb038371fb0672d1c1deb
MATLAB
1,947
53
%---------------------------------------------------------------% % This is the main script for decoding animal's current % % position using rate maps -- Wenbo Tang (Jan 05, 2023) % %---------------------------------------------------------------% clc; clear all close all; %% famnov_dir = '/Volumes/Nove...
bcd1b1a9cd026b5b3f39802067b7d8165e8656baf3d6cf940cdb2309045af5d4
MATLAB
1,951
64
% MIRO inizialization file function [im, Parameters, Transforms] = MIRO_parse_inputs(varargin) inputcellarray = varargin{1}; if ~isempty(inputcellarray), im = inputcellarray{1}; else, im = []; end %% Read File Parameters.UserSelectedCancel = 0; if ischar(im), [im, Parameters.UserSelectedCancel] = ReadTiff(im); end i...
b7546317c3a5ead07fcdbef04e3e4f38d268326f9b9ed19a0f07caa973173818
MATLAB
1,952
49
function plotsingleEvents_Fig01(Fig01) % INPUTS: 'Fig01' data structure from file % 'Neurovascular_development_Figures_PNAS_2022.mat' %README: %Plots 5min trials from 3 ages of Figure 1 panel B figure(10); %% Constants lowPass=0.5; %filter cbv data below 1Hz [z,p,k]=butter(3,lowPass/(0.5*Fig01.constants.dal_fr)...
4420d29c7e2eadc0c5b953a79a0b17e8c42384b5a3345a633d806a0bda85b9a5
MATLAB
1,953
92
function fb_mat2spark(DATA,varargin) % takes a dff matrix, assuming X,Y,Z, where Z is the time-series % % % example: % % mov_data=fb_retrieve_mov(); % fb_mat2spark(mov_data,'resize',.25,'output_type','txt'); output_file='sparkdata.txt'; output_type='txt'; resize=.25; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
360bb82b18980f2ec539b27e96969d41c8e8d36dd8b592aadbadb3f4ce7ebacc
MATLAB
1,955
54
function map = createMap(config) %CREATEMAP creates a containers.Map from a config file. % Use this class in the dependency injection framework % (depInj.createObjFromTree()). For the method field, write % 'depInj.createMap'. The struct config must have a field 'keys' with a % cell array containing all keys and...
409abad9e74ad1e292346ce09556f25fecee64e660a4ae6adf1ab1ec81258950
MATLAB
1,958
47
figure; %% Pup contact subplot('Position',[0.2 0.61 0.2 0.17]); shadedErrorBar([],mean_z_score_all_days_all_mice_pup_contact,{@mean,@stderrm},'r') yticks([-0.4 -0.2 0 0.2 0.4 0.6 0.8 1]);yticklabels({'-0.4' '-0.2' '0' '0.2' '0.4' '0.6' '0.8' '1'});xticks([0 211 422 633 844 1055 1266 1477 1688 1899]);xticklabels({'-4'...
fe487a9a6f4b50861dc839199d57c0ec4f277eacaeb1b12b3f89ed3c7479c6be
MATLAB
1,958
31
figure; %% All days averaged fathers vs mothers subplot('Position',[0.2 0.61 0.2 0.17]); shadedErrorBar([],CAMKII_mean_z_score_all_days_all_mice_pup_contact,{@mean,@stderrm},'c') yticks([-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]);yticklabels({'-0.6' '-0.4' '-0.2' '0' '0.2' '0.4' '0.6' '0.8' '1'});xticks([0 211 422 633 844 ...
165b0e94b19819622f6b3b70b8767485f79aaac88042c8fed241502ea0debaa8
MATLAB
1,962
60
function seq = simulate_tracker() %%% Function that opens an raw .tif file and performs tracking of an %%% object. close all; [file_name,~] = uigetfile('*.tif','Select Movie'); info = imfinfo(file_name); len = length(info); h1 = imshow(imread(file_name, 1)); hold on; bg = create_bg(imread(f...
11a51fc5a4d488593ec400e41156e9cd19594d45f7f583efa289f72e81012c09
MATLAB
1,966
31
figure; %% All days averaged fathers vs mothers subplot('Position',[0.2 0.61 0.2 0.17]); shadedErrorBar([],fathers_mean_z_score_all_days_all_mice_pup_contact,{@mean,@stderrm},'b') yticks([-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]);yticklabels({'-0.6' '-0.4' '-0.2' '0' '0.2' '0.4' '0.6' '0.8' '1'});xticks([0 211 422 633 844...
af782105b8a80be763be8e5e66cd3f34d96ce8c3eaf78fd81cd16621abb82d3b
MATLAB
1,968
49
function pipeline_data = create_results_folders(handles, pipeline_data) %global pipeline_data; point_paths = keys(pipeline_data.points.pathsToPoints); pt_path = point_paths{1}; [folder, ~, ~] = fileparts(pt_path); [folder, ~, ~] = fileparts(folder); % ask to name this run, save the res...
83e3b60e8e242c59c239c3749ac8e1085b9554c0c665c60f02a1427b40006d0f
MATLAB
1,969
50
function [Xout rp] = getLargestCc(Xin, conn, n) % GETLARGESTCC Returns n largest connected-components in the input N-D array. % % Inputs: % ------- % Xin - input N-D array. Required. % conn - connectivity definition, can be either a scalar or connectivity % array, with same number of dimensions as the input ...
9da39b8c206b0807b18ed325f02c3c272627c6a31108aac4085c3ee51d96dd6d
MATLAB
1,970
58
classdef SineSampleSource < SampleSource %SINESAMPLESOURCE provides samples from a single sine. % This is a very simple wavetable oscillator. For simplicity, the output % frequency is the nearest to the desired frequency that results in % an integer wavetable length. % Author: Lasse Osterhagen properties (SetAc...
894b22424e482aa40b113f331f08805bf1294d9298762708f494eaa21d267586
MATLAB
1,974
55
function samp_points=synth(sig,samp_rate,trial_dur,varargin) % SYNTH is FLANKING_BAND synth function. % SAMP_POINTS=SYNTH(SIG,SAMP_RATE,TRIAL_DUR,VARARGIN) Samples the signal % according to the givan SAMP_RATE and TRIAL_DUR. Returns the sampled % points. % varargin holds the requested Center frequency and the bandwidt...
5a0a798c0a300e5f7bb5b62742a1910b1271967f42f4e010e3fc154190ea4f5a
MATLAB
1,979
47
function phi = phi_comp_probs(type_of_dist, type_of_phi, Z, probs) %----------------------------------------------------------------------- % FUNCTION: phi_comp_probs.m % PURPOSE: Compute phi from probability distributions % % INPUTS: % type_of_dist: % 'Gauss': Gaussian distribution % ...
bacdf7eb76ad5c12714d6228490b1bd77b8c2e3080f3c63ae451e031f1f33e80
MATLAB
1,981
33
figure; %% All days and all days averaged sires vs dams % Pup contact subplot('Position',[0.2 0.61 0.2 0.17]); shadedErrorBar([],CAMKII_mean_z_score_all_days_all_mice_pup_contact,{@mean,@stderrm},'c') yticks([-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]);yticklabels({'-0.6' '-0.4' '-0.2' '0' '0.2' '0.4' '0.6' '0.8' '1'});xti...
38b3d92e2eb8695e3f5b702158e7ac418c75fe28779a514391bbad84c31262af
MATLAB
1,982
75
function mask = MIBI_get_mask(rawMaskData,cap,t,gausRad,plot,titletext,reuseFigure) % NOTE: to get original behavior, simply call % MibiGetMask(rawMaskDAta,cap,t,gausRad,1,''); % function mask = MibiGetMask(rawMaskData) % function gets a 2d matrix of raw MIBI data to use for generating a mask % and returns a mask of t...
c80474419f2e3231d0a0eceb1b73fdd91ffb6e98006b4c5d650a5f667f2fc727
MATLAB
1,992
69
function gramm_2x2_line_NSNDEvariation(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); c...
e19fa370a13ca013ec594a9486c638c8105679bd220dd37b5b00050fbae0a918
MATLAB
1,994
101
function [IMAGE,F,T]=pretty_sonogram(SIGNAL,FS,varargin) %simple 2-taper histogram (Gauss and DGauss) % % % [s,f,t]=fb_pretty_sonogram(filtfilt(b,a,mic_data./abs(max(mic_data))),fs,'low',2.5,'zeropad',0); % if nargin<2 | isempty(FS) disp('Setting FS to default: 48e3'); FS=48e3; end overlap=2000; tscale=2; N=2048; p...
cb9bdfc7a045565ae8a289b1a5cc146cdf15775cd7b0b7832c17aac29e08a387
MATLAB
1,996
80
param.font_name = "Nimbus Sans"; param.fontsize_ax = 9; param.fontsize_label = 10; param.fontsize_letters = 12; param.color_options.time_colors = [[0 0 0]; ... [0.466 0.674 0.188]; ... [0.494 0.184 0.556]]; param.color_options.cluster_colors = [[.5 .5 .5]; ... [0 0.4470 0.7410]; ... [0.8500 0.3250 0...
172196832db5e9a6a5838d8051f944d2b925bf6b46d0d32ea15ae16caa1b602f
MATLAB
2,001
73
clear all; addpath(genpath('../PhiToolbox')) %% parameters for computing phi Z = [1 2]; % partition tau = 1; % time delay N_s = 2; % number of states %% important params.tau = tau; params.number_of_states = N_s; %% generate time series from Boltzman machine N = 2; % number of units T = 10^6; % number of iterations...
b7da6fd11c8d55149e5f0b26ae27b065fe958dc43eaced86280c28edb3243b6c
MATLAB
2,001
51
clear all addpath(genpath('.')) %Connectivity of triangular faces mid_gifti_L=gifti('S1200_7T_Retinotopy181.L.midthickness_MSMAll.32k_fs_LR.surf.gii'); mid_gifti_R=gifti('S1200_7T_Retinotopy181.R.midthickness_MSMAll.32k_fs_LR.surf.gii'); tri_faces_L=mid_gifti_L.faces; save('tri_faces_L','tri_faces_L') tri_faces_R=mi...
12b8d44d9d46a66e8771783968fbad1ad5e164f6319788ef50f914a5e7830d36
MATLAB
2,003
44
function s_comp= update_input_method(s_comp,input_method,varargin) % UPDATE_INPUT_METHOD changes the input method of this signal component. % There are 3 input methods possible: 'STATIC_VALUE', 'SWEEP', 'SEQ_VALUES'. % if input_method is none of the above an error occurs. % S_COMP=UPDATE_INPUT_METHOD(S_COMP,'STATIC_VAL...
41597a06fc77db00382adea38093bee667d384a76681277cdec718cd0b370fbe
MATLAB
2,006
55
function comp = set(comp,varargin) % SET Set Freq_comp properties and return the updated object % Property names are: % Name,Sig_comp,Swp_on,Seq_on,Static_value,Sweep,Seq_values. property_argin = varargin; while length(property_argin) >= 2, prop = property_argin{1}; if ~isa(prop,'char') treat_error(['The p...
3cce34f7ccdc783d304a25e36e5a01733003ccc2a19a130eb89b0c4f57aec335
MATLAB
2,013
43
function [condition,conditionarray] = getCond(DE,NDE,PS,NS) condition= table(... [DE NDE DE NDE DE DE DE DE DE DE NDE NDE DE DE NDE NDE DE DE NDE NDE DE DE NDE NDE ]',... %the eye is identified by the suppressor [PS NS NS PS PS NS PS NS PS PS NS NS NS NS PS PS NS PS PS NS PS NS NS PS]',... %the tilt must be ...
ffd91d534341c416c51eff860de9ed7a7ed691916cae1fa3c3699ebbaba63c5c
MATLAB
2,025
64
%% LaBGAS_deriv_unzip_nii_smooth % % This script will unzip fMRIprep output images, smooth them, zip the % smoothed images, and delete all the unzipped images again % % DEPENDENCIES % SPM12 on your Matlab path % % INPUTS % preprocessed .nii.gz images outputted by fMRIprep % % OUTPUT % smoothed .nii.gz images % %_____...
3b14a27355cf3023602fe39facf0b1ed7fd4ca818c28c83460c0c67457b058f5
MATLAB
2,030
52
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <loadRAMRgen3: imports GEN3 RespirAct data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foun...
0f5ac5931ef8563fa7bcc499e42cb147b8d11ef0aa1430f59b81261a35c8cc80
MATLAB
2,031
68
function plot_error_data(ax, param) % Last modification: JN 2021-01-28 S = load(fullfile('..', 'data', 'error_data.mat')); data_table = S.data_table; axes(ax); ax.NextPlot = "add"; grid on; cols = {'N_correct', 'N_at_prev_port', 'N_other_err', 'N_not_at_port'}; %colors = {[0 .5 0], [.7 .4 0], 'b', 'k'}; colors = {[0...
9f56a66fd79f72017b7110fc155288c9df41594470b84a88230bad22745422ea
MATLAB
2,032
63
function export_to_xls(diff_attention_effect, diff_SAT_effect, type2AUC, fmri_attention_effect, fmri_SAT_effect, fmri_type2AUC) number_subjects = size(diff_attention_effect,1); %% EACH OF THE 3 MEASURES SEPARATELY (4 REGIONS) %File name output_path = pwd; file_name_separateMeasures = fullfile(output_path,'R mixed-ef...
c8bfffb5420c93a13da4d3782db184511d4e7d1d415618feb581b874eec8a0b6
MATLAB
2,036
53
function makeToneThresholdExpFiles(subjectID) %MAKETONETHRESHOLDEXPFILES creates tone detection experiment files from fixed %parameters. % Arguments: % subjectID - a string identifying the subject for which the session % files are constructed. % % All parameters are fixed according to our current practice f...
d5935a64b3838006de1651e26e8aae229bb5791b8dee931e3f687baa2e7fbc5a
MATLAB
2,037
78
function [adjMatSNR,embDistSNR] = segmentSNR(measure,DataSet,varargin) %compareSNR Compare variation across vs within over time % For optional arguments, see '+ecogutils/postHocOptionsParser.m' and the % help for +patientSummaries/stateAverage.m % threshold = 1/3; o = ecogutils.postHocOptionsParser(measure,...
f067b862b079cb9d2d0df2513454febb4544ff94c2ad40e31a42c87f315edd4e
MATLAB
2,038
59
classdef (Abstract) AudioObject < matlab.mixin.Heterogeneous %AUDIOOBJECT can be played by an AudioPlayer. % This class is the base class for all classes that can be read % by an AudioPlayer for sending data to the sound interface. % It implements the matlab.mixin.Heterogeneous interface to allow the % creation...
87b530041bd861e07e38dfcaedf305fedcad270d71c064e3600836ee582a50a7
MATLAB
2,049
91
function visIDX_monocPlots(IDX,dataType) %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; % % {'Monocualr PS DE' } % {'Monocualr NS NDE' } % {'Monocualr NS DE' } % {'Monocualr PS NDE' ...
a21f13df6a24e2129ad6263ba04e7ff7dd3aeb2cc2d71d502912a0817c1fd8af
MATLAB
2,049
85
clc clear close all load for_fig02_N1_exe.mat figure('Units','normalized','OuterPosition',[.1 .1 .08 .45]) plotit(FR_b, t_b, 0); load for_fig02_N1_obs.mat hold on plotit(FR_b, t_b, 1); load for_fig02_N2_exe.mat figure('Units','normalized','OuterPosition',[.18 .1 .08 .45]) plotit(FR_b, t_b, 0); load for_fig02_N2_obs...
ed2a6347355cb8e46bb5f4d0c730dbedc227e153a5228428b965c7d5e16ebdc5
MATLAB
2,049
53
%% % Function Inputs % total_synapses: total number of synapses % distribution: binomial with parameter p (prob. of success) % 0 for not ensheathed % 1 for ensheathed % d_parameter: distribution parameter % p (probability of selecting zero ensheathment % synapse_type (Note: IE reads, excitato...
1bb3355dc7a59ef109bb8743180d53d471fcc07777604d80e9252b30a2f734ff
MATLAB
2,054
57
function val = get(coord,prop_name) % GET Get Coordinator property from the specified object % and return the value. Property names are: % Components - list of the components of the object this Coordinator handle % Num_of_comp - number of components of the object this Coordinator handle % Old_ooord_indices - the origin...
7663ff237afb33177b3806e6bd0d587672430e2cdf1588c5d9e75010798b5541
MATLAB
2,055
41
function file_format_data=get_file_format_vals(env,signal_table,line_num,chan_num,line_trial_num,env_num,line_trials) % FILE_FORMAT_DATA returns a string that consist of a number of MATLAB % commands. These are initialization and setting commands. % For each component of the Envelope a varaible of the form : % MTF_1_F...
4e20766fb84f5fa0d017d5899c8296126aed520d1e3abf37b9ed773143ac4f51
MATLAB
2,058
79
% compute several measures of integrated information in a multivariate autoregressive model, % X^t = A*X^{t-1} + E, % where A is a connectivity matrix and E is gaussian noise. clear all; addpath(genpath('../PhiToolbox')) %% parameters for computing phi Z = [1 2]; % partition with which phi is computed tau = 1; % ti...
c1e135dd523adbc2247a704964de96f38b2494d443967a09d9c2ccf57eace4dc
MATLAB
2,059
64
% It is a code to calculate velocity and position from accelerometer % acc_data: accelerometer data % sf: sampling frequency ex) sf=600.615; % Copyright (c) 2023 Hong Gi Yeom function [velocity, position]=acc2pos(acc_data,sf) d_ord=10; % detrend oder eve=length(acc_data); for i=1:size(acc_data,2) events_size(i)=s...
0020acf17e185928e0f5fdb423731c9a2405771bb16884dd5cc8e9e711e735bf
MATLAB
2,063
68
clc close all clear figure('Units','normalized','OuterPosition',[.1 .1 .03 .2]) hold on [perc(1), CI(:,1)] = prep4fig5C('action_preference'); [perc(2), CI(:,2)] = prep4fig5C('LDA'); for i = 1:2 line([i i],[CI(1,i) CI(2,i)],'color',[.7 .7 .7],... 'linewidth',3) end c = lines(7); plot(1:2,perc,'color','...
6ace8d1dabb0727aedc5e68ae21bd9d3b9d7389d9092aeec98500e0a88765a2d
MATLAB
2,064
66
function NS_SaveFig(chPath, hFIG, cFIGNAME, chOption) % Utility to save figures. Save figures in the handle vector hFIG in the folder % provided by chPath under the names provided in the cell array cFIGNAME; By % default a .eps, .png and .pdf files are saved. This can be controled by the % option string chOption. To s...
8669675811914b0b82b503eb76811e4cc929ed61e2c38d35675ca00029f384f1
MATLAB
2,068
58
function [table_events, table_filestarts, TTL] = ... DT_deuteron_preparation(folders) % JN 2020-04-22 % this function runs all the steps required for a recording session with % the logger % Parse the autolog (coming from the transceiver) fname_ttl = fullfile(folders.results, 'deuteron_autolog_parsed.mat'); if is...
dc009e431fa3db33dafe7df28ae9b5dc1da4cc9fe367f507b278383852d97b5f
MATLAB
2,068
67
%% Intensity analysis of fluorescence %% Preprocessing: % Images must be processed to the same size (i.e., 5.0 x 5.0 mm) %% Define the parameters of images pixelPerMM = 769; %pixel/mm value radiusOfAnalysis = 1; %radius of circular ROI (mm) imageSize = 5; %Image size (mm) imageExtension = 'tif'; %Image file...
c63e5e423e3fae70b9424ff42840340095b312533093f2a58d83df17102e25c7
MATLAB
2,071
59
% iScienceSub_findTimingOffset.m % Written by BMC - 10/1/2022 % This code needs to help us decide which parameters to use for the BRFS % iScience submission. These include contrast levels, time period of % stastical comparison, and format of normalization. % We will plot monoc vs dCOS in 9 plots (3x3 facit gid) % X ...
105837951dd5a1f48846ebc1761d069ce5b14568a56ddad0161a4820b29229f8
MATLAB
2,073
74
function stats = getSessionStats(trials, headerStr, adjustedFalseAlarmRate) %GETSESSIONSTATS calculates statistics for a detection experiment session. % Arguments: % trials - an array of trial structs % headerStr - the field name of the trial struct that identifies the % grouping factor % adjustedFalseAla...
49896db3328caba2d5705018a6e5260a3bc7063b7bc1e3258a8c900afb5c174e
MATLAB
2,073
49
figure; %Heatmaps of mean GCaMP7s fiber photometry signals from ACCVGAT neurons in dams. %The signals are aligned to the entry of the dam to the nest (F) and the exit of the dam from the nest (G) after retrieval of all pups. %Each row represents the mean z-score from postnatal day 0-5 for each mouse (n = 5 mice). %% ...
67c0f8ffb891a7597ad7da9e7a822e3a90e1b0434cbe1faf831eed576a1f4c7d
MATLAB
2,078
55
function process_neural_data_kilosort2(in_folder, out_folder, mode, fnums, ... table_filestarts, is_unfiltered, mpx_prefix) params = struct(); switch mode case 'deuteron' params.relevant_channels = 1:32; files_per_run = 50; params.KHz_Orig = 32; params.KHz = 32; params...
b70a070fee9393bc1e19678b022c32988ca6148bb5bf401769db408323bdc35e
MATLAB
2,079
57
function ASLQASL_SSVBanalysis(SUBJECT, locationASLlabelcontrolPLDNIFTI, locationM0, locationMask, outputmap, PLDlist, artoff, spatialoff) % ClinicalASL toolbox 2023, JCWSiero PLDstring = sprintf('%.05g,' , SUBJECT.PLDS(PLDlist)); PLDstring = PLDstring(1:end-1);% strip final comma if nargin >= 7 if strcmp (a...
fd45c0c0e237f97fa63cd65190de3685474010c5c900b8560a553778add6a968
MATLAB
2,079
57
%% % Loops over the strengths of the stimuli considered % Default is fours values (none, low, med, and high) % % Returns the firing rates (of the mean field model) and the eigenvalues to % assess the stability of the system %% function [firing_rates_sol,nan_warning,warning_notice, eig_values, d_min, real_eig_max]... ...
8f50302d713183794d9668e22dd1bd864df9b7c8f56bcced20ca1022981da940
MATLAB
2,086
68
% % spktrain2fr v1.0 % 07.10.2020 % Mohammad Shams % m.shamsahmar@gmail.com % % Replaces spikes in a spike train with a normalized Gaussian % NOTE: to avoid artifacts at the endpoints, marginal spikes will be replaced with partial Gaussians of similar energy as the rest. % % convolved_spike_train = spktrain2fr(spike_tr...
0a5ec5014e6f8e0d9fa6915c51845bb08e6bb2485f5c4fe45cb3113f7a6f5bc7
MATLAB
2,094
77
function mask = MIBI_get_mask_graded(rawMaskData,cap,t,gausRad,plot,titletext,reuseFigure) % NOTE: to get original behavior, simply call % MibiGetMask(rawMaskDAta,cap,t,gausRad,1,''); % function mask = MibiGetMask(rawMaskData) % function gets a 2d matrix of raw MIBI data to use for generating a mask % and returns a ma...
ad4070bf41b12ecb66dbacb22a7ceb2681c4e88dde9c4f3bdd6fb76d5927bd9b
MATLAB
2,094
67
% Authors : Tatjana Schmitt & Simon Wadle 2019-2022 %function reads tiff stacks and scales pixels down to end size function resized_image = tiff_stack_resize_block_process(input_stack, end_size) [rows, columns, stack_sz] = size(input_stack); block_size = [rows/end_size(1,1), columns/end_size(1,2)]; single_blo...
44e89673ccee001e927020f9c6ce0c670f5737844f411e23afa8898eb4c9f677
MATLAB
2,095
70
function probs = est_p(X, N_s, tau, isjoint) %------------------------------------------------------------------------------------------------- % PURPOSE: estimate probability distributions of past (p_past), present (p_present) and % joint distribution of past and present (joint) from discretized time series data X ...
b7e66c1ca95d2487f78398d62804ca3ddca35f1d6902b9b15b59040ee5e4653d
MATLAB
2,095
61
function info=get_crids_info(sig,crid_arr); % GET_CRIDS_INFO returns information of components with the specified crids. comp_crids=''; main_sig=get(sig,'Main_signal'); comp_list=get(main_sig,'Comp_list'); num_env=get(main_sig,'Num_of_env'); len=length(crid_arr); for k=1:len counter=1; crid_title=['Unwrapped...
c0069b969bd9cf6d2780ded729c0531fa16bb47c41db6bc530cb17d69af76e4f
MATLAB
2,098
55
function noise=makeSomeNoise(calib, Fs, level, dur, cutoff, gate) %MAKESOMENOISE creates bandpass noise of a specified level % Arguments % calib - calibration struct % Fs - sample frequency % level - target level % dur - duration in seconds % cutoff - passband frequencies: [low high] % gate - onset/offset...
5fe0d9ade1809586cb1ca8925ee64d582094a4d02890b273a314f8cedd725112
MATLAB
2,099
59
function [ phi_G, Cov_E_p, A_p ] = phi_G_Gauss( Cov_X, Cov_XY, Cov_Y, Z, method ) %------------------------------------------------------------------------------------------ %PURPOSE: calculate integrated information "phi_G" based on information geometry % See Oizumi et al., 2016, PNAS for the details % http://www.pn...
86dae0ae4ecf00763838fae3962cc3acdf24372b1a2b6c37d01926e8baf6d7b7
MATLAB
2,102
34
figure; %% All days averaged sires vs dams. %Plots of the mean Z-scored traces of ACCCAMKII neurons for all mice and all days, contrasting dams (red) and sires (black). %Pup contact subplot('Position',[0.2 0.61 0.2 0.17]); shadedErrorBar([],fathers_mean_z_score_all_days_all_mice_pup_contact,{@mean,@stderrm},'k') yt...
f6dff4e25b83ef2b981d047753161f8646b357b092408a7acba824382bbe8d5e
MATLAB
2,106
35
%written by Alex Bhogal a.bhogal@umcutrecht.nl %script to save nii images loaded using loadImageData script. %Data can me manipulated but header should be the same function [] = saveImageData(data, header, pathname, filename, datatype) % 0 None (Unknown bit per voxel) % DT_NONE, DT_UNKNO...
b59bec9e38d24dae09292febbaccacfc3cab3ebb008391f9f82f734b1e2a916f
MATLAB
2,113
63
classdef LaserBlockCtrl < AudioObject %LASERBLOCKCTRL is an AudioObject for controlling a Laser. % Input arguments: % id, % channel, % from channel mapping % duration, % sec % dcAmplitude % sample value (0 to 1) % % The purpose of this class is to let the AudioPlayer play (D...
1ec5c1d50fa7b287c4dda558e2f3f224fa07073c1d4bae77e36fcadf97942476
MATLAB
2,115
39
function [Result,pData,DataCapture,TS_FirstSample] = AO_GetAlignedData(ChannelIdArr,ChannelCount) %Function used to get aligned data from several channels %ChannelIdArr :array of channels which we need to get data from,all channels must have the same sampling rate %ChannelCount :number of channels listed ...
771b981e20d2ac74b4021d4cf6e727c3c3f904c47c28bb10f0f7796284aa4e32
MATLAB
2,117
55
function comp = set(comp,varargin) % SET Set Depth_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin; whi...
05e9a483eb09b6547660ec1909d15c683dfc81a9b3155dcdefc112409b9e84d0
MATLAB
2,118
77
function gramm_adaptation_line(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear Dat...
71efb751f3a5b670fc20e07fd0e48bad0c94df3edfee6a7c0feee39a58ccbae9
MATLAB
2,120
56
function comp = set(comp,varargin) % SET Set ETime_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin; whi...
f68a5f414e003bb329ba204f9d2acbb0f7ad59ba111bd440ac200fe7ded9f8f4
MATLAB
2,123
63
classdef LaserBlockCtrlSampleFactory < AudioObjectSampleFactory %LASERBLOCKCTRLSAMPLEFACTORY creates samples from a LaserBlockCtrl. % Author: Lasse Osterhagen properties % Sample frequency sF % Number of channels needed (inclusive sound channel, exclusive % trigger channel) numChannels end method...
700df0b83b2a7d9111aa5f514bb71c7e484722ea698746401e6c7692ec159206
MATLAB
2,124
57
function comp = set(comp,varargin) % SET Set Phase_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin; whi...
794d97e60a832ddd17ecbabb59bb8ab27286b18842b8b37f44e49f806b21c03e
MATLAB
2,129
68
clc close all clear figure('Units','normalized','OuterPosition',[.1 .1 .05 .2]) hold on [perc(1), CI(:,1)] = prep4cibra('discharge'); [perc(2), CI(:,2)] = prep4cibra('action_preference'); [perc(3), CI(:,3)] = prep4cibra('LDA'); for i = 1:3 line([i i],[CI(1,i) CI(2,i)],'color',[.7 .7 .7],... 'linewidth'...
46b12933747c629047a674ad826208a1c4ee92dd04106d8e31d974ebfdab2d5a
MATLAB
2,130
51
function objMatrix = createObjMatrix(s) %CREATEOBJMATRIX creates a matrix of objects of a single class. % Use this class in the dependency injection framework % (depInj.createObjFromTree()). % For the method field, write 'depInj.createObjMatrix'. Another field % named 'constructor' contains the constructor meth...
4f7b71e152417ec49c507575e1b3e37b00a0ea19a5c39370bb27b0f05d12616f
MATLAB
2,130
56
function comp = set(comp,varargin) % SET Set STime_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin; whi...
af94f5052311fca04d549ae4c101537f42271ebb9134c03354697386a9b9c1d5
MATLAB
2,133
79
function data = D_BAND_BASIC_NODECI( data_in, data_fs, band, band_name, varargin ) % example input % data = D_BAND_BASIC_NODECI(croppedSDF, 1000, [70 150], 'highGamma') band_name_fs = [band_name '_fs']; data.(band_name).hpc = band(2); data.(band_name).lpc1 = band(1); data.(band_name).lpc2 = band(1)/2; filt_order = ...
2da4e2f24e383d0034826c852340a78ddfaa3a2093d7f1fa74d84c870083dbb7
MATLAB
2,134
92
% function [] = grab_frame() %GRAB_FRAME Function that grabs frames from camera and measures latency of % hardware and connections. % % Run options: % % >> grab_frame( input_args ) % % Written by Alex@Eli_lab 7.9.16 %%% Using tisimaq_r2013 delete(cam); cam = videoinput('...
298d75888838b83d857af6d9491743e42aa29f09598f0ec526b1513adc1ca22d
MATLAB
2,137
64
%Author: Tatjana Schmitt 2019-2022 function FRA_analysis_subfields(root_path) % get file temp_filepath_FRAanalysis = [root_path, '\**\FRA analysis retroIC.mat']; FRA_file = dir(temp_filepath_FRAanalysis); FRA_path = FRA_file.folder; FRA_name = FRA_file.name; load(fullfile(FRA_path, FRA_name), 'tuning_overvie...
2f9ac22a07f87599928f1edecc704f7c87ffc996f3ede3fcc63306a5aa5875af
MATLAB
2,137
48
function file_format_data=get_file_format(env,line_num,chan_num,env_num) % GET_FILE_FORMAT returns a string that consist of a number of MATLAB % commands. These are setting commands which are based on the Envelope's % components status at the given line,channel and envelope-index. % This string is meant to be written ...
4f419e861a72ec81e3d62f3204d180342fc1c7f1831f6a2077dc071e56149020
MATLAB
2,141
49
function filters = MIRO_SLprepareFilters2D(rows,cols,nScales,shearLevels,directionalFilter,scalingFilter,waveletFilter,scalingFilter2) %% Prepare wedge and bandpass filters for the computation of 2D shearlets. %%check input arguments if nargin < 3 error('Too few input arguments!'); end if nargin < 8 if nargin ...
0e786dd1b63e16c17bb795328bbce82dec25b9aedfce652cf349f2e4d1b0fb40
MATLAB
2,148
84
function [EXTRACTED_SOUND,EXTRACTED_IMAGE,TIME_POINTS]=spectro_navigate(DATA) %simple GUI for selecting a sound using its spectrogram % % [EXTRACTED_SOUND,EXTRACTED_IMAGE]=spectro_navigate(DATA,DIR) % % % DIR % if given then brings up an interface to select a particular file % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % par...
0ee9e638327b9d0cb31884fc3c1b71297bb0ed975340e6c56e099a79cc0e6ab1
MATLAB
2,149
57
function comp = set(comp,varargin) % SET Set Ramp_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin; whil...
b5b147d20985b2a6cbe6ac91898421ba4c94df3bfd4ea7e8db9cf137a83d907e
MATLAB
2,153
77
%script for analyzing surface-based data -- clean-up in progress function analyzeSurfData ( subj_list ,prepdwi_dir,parcellation_name, target_labels_txt,out_folder,bids_tags) % here, we just want to write out the csv tables % definitions data_dir='.'; % read in $target_labels_txt from parcellate_cfg for list of t...
88433cf8f60cbd2d362a4b73142edeb579397673c8855ceccb96d6900e79d2ae
MATLAB
2,160
94
classdef (Abstract) DetectionGUI < handle %DETECTIONGUI is the base class for stimulus detection GUIs. % Author: Lasse Osterhagen properties % Current subject id subjectID % Path and file name prefix, where the LogBook will be saved filePathPrefix end properties (Access = protected) % ExperimentC...
3824feed2afd8183d331399b321dd49660872158e88c5579b9647cfcd23c4591
MATLAB
2,165
89
function visIDX_dCOSFig(IDX,dataType) %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).tm; uctLength = length(IDX.allV1); % B. pull out all laminar matrices 3x(6,450,el#) %preallocate SDF = nan(size(IDX.allV1(1).SDF.raw,1),size(IDX.allV1(1).SDF.raw,2),uctLength);...
9ddfe3c1a2dec4c951c641d5acb5e34fbed579fd6b42b235c04690ced0543f19
MATLAB
2,168
61
function thre = func_threshold(I) % Compute an optimal threshold for seperating the data into two classes [1]. % This algorithm can be summarized as follows. The histogram is initially segmented into two % parts using a a randonly-select starting threshold value (denoted as % T(1)). Then, the data are classified...
de522e68e23794daf29c74c8f09bb5279d107eb0db10c82a34db22bd773e4ed7
MATLAB
2,169
50
function plot_4bars_withinError_3subplots(data, t_values, reference, ylabel_string, ylimit) figure for effect=1:3 number_subjects = size(data{effect},1); for i=1:4 if i~=reference(effect) SD(i)=compute_sd_from_t(mean(data{effect}(:,reference(effect)) - data{effect}(:,i)), t_values{effect}(...
b0fb20cefa39cf51c9bc64b56dbb96c85d525a7ca6a849de3b2fdbe762807ab9
MATLAB
2,174
92
function plot_supp_1(ax, S, param) ns_pre = S.ns_pre; thr = .25; dset = S.dset; time_const = 29.997; rats = 4:5; days = 22:23; start_time = .5; % sec after prev_fdb stop_time = 9; % sec after prev_fdb start_samp = round(start_time * time_const) + ns_pre; stop_samp = round(stop_time * time_const) + ns_pre; time_v...
196c6299b4fb3a20463f2050cfadcdced176b399f45715dfe4d0d00899f4e76c
MATLAB
2,177
65
load("timeseries.Yeo2011.mm316.mat"); output_dir = "full_data_positive_linear"; mkdir(output_dir); total_negative = 0; for m = 1:316 subject_mx645 = corrcoef(transpose(subjects(m).mx645)); subject_mx1400 = corrcoef(transpose(subjects(m).mx1400)); subject_std2500 = corrcoef(transpose(subjects(m).std2500)); ...
0638ea62b881a39232320723c468a2c81401bbede7d2c1a3cbc574bd428cdfbb
MATLAB
2,179
65
load("timeseries.Yeo2011.mm316.mat"); output_dir = "full_data_negative_linear"; mkdir(output_dir); total_positive = 0; for m = 1:316 subject_mx645 = corrcoef(transpose(subjects(m).mx645)); subject_mx1400 = corrcoef(transpose(subjects(m).mx1400)); subject_std2500 = corrcoef(transpose(subjects(m).std2500)); ...
533373b4591ea268f02e08ca6b55879336bc0e0a4227bf4d7c5e30db94f0d841
MATLAB
2,184
61
function [accuracy,p_value,accuracy_shuf] = decoding_dichotomy_linearSVM(dat_all) %---------------------------------------------------------------% % This is the function for decoding dichotomies using % % linear decoder (linear SVMs) % % -- Wenbo Tang (Jul 13, 2022) ...
58d369b3ee30dfbba8049ab561c2c768cdbba067c90664136410dfe519e449cf
MATLAB
2,188
55
function [BI,sigBI,randBI] = compute_behavior_information(calcium_data,calcium_time,calcium_fps,... behav_data,behav_time,behav_fps,... nrand) % This function calculates the 'behavior information' and its significan...
f7723c846bcc9141f79f5baf22f0a8fa2eaaac3bfef1a349e2c7b60453a41e60
MATLAB
2,193
57
function comp = set(comp,varargin) % SET Set Trial_dur_comp properties and return the updated object. % Property names are: % Sig_comp,Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Fixed_num_data, Sweep. property_argin = varargin;...
a6802ef9c8c71212a087d95cf0ee571208cfd8b4a5f1b1d49e1aa045538be4da
MATLAB
2,208
68
%*******Alex Bhogal 1/29/2019 %function to load niftii images untouched. Output is the image data %and info structure containing matrix and resolution info function [image info] = loadTimeseries(pathname, filename) warning('off') global opts; if isfield(opts,'verbose'); else opts.verbose = 0; end if ~ispc ...