sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c0807d5e725968241a88cd72ab35ceaf85ba94a1ab513b800935377c3a7952a8 | MATLAB | 5,655 | 148 | function [params_fitting, gof_fitting] = ...
FittingEquations_Submission(data_x, data_y, params)
% Since the equation to be fitted is quite extensive and complicated, it is
% then necessary to perform in a different code to avoid overwritting in
% MatlabCode_for_Figures.m
% UPDATES:
% 15.07.2022: Red... |
d39b3f4f5cd2cab7157b23c9864e1b5f0207e52235f8c0466df6af197789d4b1 | MATLAB | 5,657 | 162 | % This function compares patches' similarity and groups them accordingly
function [Final_noisy_blocks, Final_similar_blocks, blk_positions, Count, sigma] = MIRO_Needle_match(NoisyImg, BasicImg, BlockPoint, N, sigma_g, lambda_W, D, DD, parameters, adaptive_on)%#codegen
%% Load parameters
Blk_Size = parameters(1); ... |
bc74056ca35c178f1dc87226960584d15be0c080443979b4c5b80dd592805206 | MATLAB | 5,671 | 207 | function Client_test()
%%
RPX1=RX8(1);
circ_samp_rate=get_samp_rate(RPX1);
err=load_circuit(RPX1);
if ~isempty(err)
errordlg(err,'Bad input error','replace');
return;
end
PA5list = cell(1,12);
pa5perm=[1 3 2 4 5 7 6 8 9 11 10 12];
for i = 1:length(PA5list)
PA5list{i} = PA5(pa5perm(i));
end
[check_connect,co... |
4fc7c07ac95078e2a80055400dff500330996fb0f82bff79d9249355da30c336 | MATLAB | 5,677 | 151 | function J = MIRO_nlm(I,Options)
% This function NLMF performs Non-Local Means noise filtering of
% 2D grey/color or 3D image data. The function is partly c-coded for
% cpu efficient filtering.
%
% Function:
%
% J = NLMF( I, Options);
%
% inputs,
% I : 2D grey/color or 3D image data, of type Double
% in r... |
4d12d597306bc1ac755c89e43e41e9990113c512a828633ac87c874603682643 | MATLAB | 5,686 | 201 | function [handles] = tdrPlotResponse1D(data,plotpars)
% tdrPlotResponse1D population trajectories subspace dimension
%
% Inputs:
% data: population response
% plotpars: plotting parameters
% .dimension: labels of dimensions to plot {2 1}
% .average_trials: average trials, if more than one found (1 or 0)
% ... |
9351656b93ba32c1a076fe04d290ddb93f5c0d36fae2dc7b7dabdb58b8fa0a5b | MATLAB | 5,696 | 158 | function visIDX_fig3_fromAUTO(IDX,dataType)
%% taken from visIDX_fig3aAllV1_CvsIC.m
% viIDX_fig3_fromAUTO.m can be found in Visualization functions.
% It takes the SDFs from all of V1 in the IDX variable and averages them
% together. This can be done with raw dMUA inputs or z-scored inputs.
% Both are plotted in dM... |
72b2239748255d9d205ca8c04f51aac784aed345b17c4f4d9f72cee726dcb2e4 | MATLAB | 5,707 | 163 | classdef FilesSampleSource < SampleSource
%FILESSAMPLESOURCE provides continuous samples from at least two files.
% These samples typically are used as a sound background (e. g.
% background noise) in a signal detection paradigm.
% Just before all samples of a file are consumed, cossfading between the
% current... |
0c209d41dc46d9302a325cafee006ae366d7afbefb83135fc1d64abf679ebd9e | MATLAB | 5,751 | 155 | function [app,behavDIO,soundinfo]=nextStateAction(app)
s = app.MDPState;
r = app.RATState;
nAreas = 6;
behavDIO.action=0;
soundinfo.toplay=0;
s.soundIsPlaying=soundIsPlaying(app);
s.behavior = categorical({'no'});
if s.type=='center' %center area: always plays a random sound that indicates a rewrd state
%select... |
ab460acd706564548755c56377fc7012b78b2891ce347b730c104e37be729d51 | MATLAB | 5,806 | 234 | function roi_ave= FS_Plot_ROI(ROIS,varargin)
% FS_Plot_ROI.m
% Selects an arbitrary number of roi's for plotting. Run in .mat directory.
% Created: 2015/08/02
% By: WALIII
% Updated: 2016/02/15
% By: WALIII
%% Starting Variables
colors=eval(['winter(' num2str(length(ROIS.coordinates)) ')']);
sono_colormap='ho... |
fd9d7ebc712993ed0ce12ac0e14e0c7d762a6111484ce840e9241fa484777f51 | MATLAB | 5,846 | 200 | function [sdata,handles] = tdrPlotResponse2D(data,plotpars)
% tdrPlotResponse2D population trajectories in 2D subspace
%
% Inputs:
% data: population response
% plotpars: plotting parameters
% .dimension: labels of dimensions to plot {2 1}
% .average_trials: average trials, if more than one found (1 or 0)
% ... |
e063b6acfd102075f0b40cfcf84b73d6b73469eb21dc398dbcfb39a849714ee6 | MATLAB | 5,851 | 177 | function out = type2_SDT_MLE(input1, input2, input3, input4, input5, input6)
% out = type2_SDT(input)
%
% Given data from an experiment where an observer discriminates between two
% stimulus alternatives on every trial and provides confidence ratings,
% provides a type 2 SDT analysis of the data.
%
% The funct... |
5c2ffb5d6ebe65a7bf4442776b1e42fa4da7e8c10e68b68b3ad0b7b9319a0859 | MATLAB | 5,864 | 147 | function [first_raw_f_name, f_names] = multiple_raw_NA_to_bin(origin_dir, is_new_layout, neural_mode)
% Function multiple_raw_NA_to_bin prepares the binary files for the Kilosort2 run.
% It reads sub-set of raw_??_??.mat files as produced by the integration pipeline,
% and writes the contents to a single .... |
d661065b82a207f46a1d9c1004c8bf0784f9b4bd91631fe2952ef873107d46bf | MATLAB | 5,889 | 240 | function [MG, S, TM, Nmax]=fth(I,Nth,method,smooth,OPTS)
%
% FTH Fuzzy thresholding segmentation of 2D data
%
% V. 4.0 (Overwrites old SEG_fuzzy.m)
%
% Usage
%
% MG=fch(I);
% MG=fch(I,3,1,1.5);
%
% INPUT
% I input image (2D, double or uint8)
% Nth: Number of output centroids
% (D... |
a26572994f6a6d0e0b791004f6dd959b9e2311411a847a4903e01a230660f3aa | MATLAB | 5,893 | 122 | function filters = SLprepareFilters2D(rows,cols,nScales,shearLevels,directionalFilter,scalingFilter,waveletFilter,scalingFilter2)
%SLprepareFilters2D Prepare wedge and bandpass filters for the computation of 2D shearlets.
%
%Usage:
%
% filters = SLprepareFilters2D(rows, cols, nScales)
% filters = SLprepareFilters2D(ro... |
1a266bd5298bce728e6fbc63fe21b1d68d189af9792ee88608585e82674fcaff | MATLAB | 5,898 | 171 | % twoUnit_TestSortConfigs
%BMC - 10/8/2020
% The purpose of this code is a result of my conversation with Alex on
% 10/7/2020, wherin I outlined the reults of checkKiloSortOutputs.m
% The new goal of this code is to compare two units on session 151221 under
% different sort conditions so as to be abole to play with t... |
6dda12116ce973e53899ffe4daa2ab4a8c26cbf189c54f469c85e8ff66fee56c | MATLAB | 5,919 | 178 | function behavior_analysis(behavior_table, out_folder)
%BEHAVIOR_FIGURES Summary of this function goes here
% Detailed explanation goes here
%% histogram of nosepokes per area
np_port = behavior_table.port(behavior_table.event_type == 'nosepoke');
[count,port] = hist(np_port,unique(np_port));
all_ports = zeros(1,12)... |
7f2660dd22514caa33eea83f7914575d4ba901d52f3fd6a887f8fd788df6d2fd | MATLAB | 5,922 | 197 | function hAxes = dscatter(X,Y, varargin)
% DSCATTER creates a scatter plot coloured by density.
%
% DSCATTER(X,Y) creates a scatterplot of X and Y at the locations
% specified by the vectors X and Y (which must be the same size), colored
% by the density of the points.
%
% DSCATTER(...,'MARKER',M) allows you to... |
89f0bcf07d58a2307030a511ac3d0b9a0ded2a6e997c2d8d46392c037fe5fda1 | MATLAB | 5,927 | 164 | function trials_table= get_table(s_coord,rnd_builder)
% GET_TABLE returns the table of values of all components.
% TRIALS_TABLE=GET_TABLE(S_COORD,RND_BUILDER) returns the table of
% values of all components.
% RND_BUILDER is a 2-rows cell array that holds for each crid
% the random order of choosing it's values (used... |
159b614f14611db6b25468f4d1e2c61f4a7428364ae6f7ff37551f24db8823b8 | MATLAB | 5,940 | 161 | %---------------------------------------------------------------%
% This is the script for plotting the linearized rate maps for %
% spatially-tuned cells -- Wenbo Tang (Jan 05, 2023) %
%---------------------------------------------------------------%
clc
close all
clear all;
%%
% set directory
famnov_dir =... |
1d8345c8a95c778fcef9c106360116013b1239ac8782de86766c19b1e772f7d1 | MATLAB | 5,959 | 134 | %Generate a figure for each CPD component contains subplots of temporal (time)
%spectral (frequency), spatial (channels), and subjects. Plotting channels
%activations on the left and right hemisphere. Taking condition indeces to
% use in bar plots
function CPD_plots(U,r_components,left,condition_ind,con... |
688c67a0d19fde47b6d6574bf682fc380b1c3713be6b687a3dc69dbb00b539ce | MATLAB | 5,968 | 204 | %% call function to create DSGN structure array, and define subjectdirs
DSGN = LaBGAS_get_single_trial_dsgn_obj();
sid = dir([DSGN.modeldir,'\sub-*']);
sid = {sid(:).name};
for i = 1:size(sid,2)
subjmodeldirs{i} = [DSGN.modeldir '\' sid{i}];
end
%% loop over subjects
for j = 2:size(subjmodeldirs,2)
loa... |
7dc40f9c079118809c25775cf83c1e01836646f2fb50cb4723e808d459b7cdac | MATLAB | 5,969 | 142 | classdef FileBlockedStatsAccumulator < handle
%FILESTATSACCUMULATOR accumulates session stats from saved experimental
%data.
% Similar to FileStatsAccumulator, but for experiments with multiple
% blocked trials.
% Author: Lasse Osterhagen
properties (SetAccess = private)
% Higher false alarm rates will let th... |
bf0d94510cb91cea5a741e6e30ab83a0c02d1dd797f66d1574d19a262e550fe1 | MATLAB | 6,030 | 104 |
% ClinicalASL toolbox 2023, JCWSiero
%%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% written by Jeroen Siero 25-05-2023 for the MOYAMOYA study
% includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smo... |
5df3701500c2adc9354d64acc9e1503546af5d02777f3b122391e6eedfd3c91d | MATLAB | 6,051 | 213 | function [IDX,sep] = otsu(I,n)
%OTSU Global image thresholding/segmentation using Otsu's method.
% IDX = OTSU(I,N) segments the image I into N classes by means of Otsu's
% N-thresholding method. OTSU returns an array IDX containing the cluster
% indices (from 1 to N) of each point. Zero values are assigned ... |
54557f0f82db001a1d3a206046df916f3d89b6e2b83448726ac5246add40b62b | MATLAB | 6,063 | 128 | function TD_anova_plot(timept_only_sig_component,...
chan_only_sig_component,left,cpd_dir,dir,name,namePNG)
load(strcat(cpd_dir,'/LMLRA_all'));%, 'U_left','U_right','condition_ind',...
%'tensor_right', 'tensor_left','Sol_left','Sol_right','size_core_left',...
%'size_core_right','conditions_title','con... |
9bf46b63b3d396b56bf20949742cab923b0246ead4a87c20328e1ab6f972e3c5 | MATLAB | 6,084 | 149 | %---------------------------------------------------------------%
% This is the main script for CCGP of task sequences %
% using linear SVMs; Libsvm MATLAB toolbox (V3.22) is needed %
% (https://www.csie.ntu.edu.tw/~cjlin/libsvm/). %
% -- Wenbo Tang (Jan 07, 2023) ... |
acfadd06475e6f071f277b101dce5d17377eafc9915d8a785fe2b835ab4baa42 | MATLAB | 6,103 | 178 | % Spontaneous neural activity during fixation task
% Fig. 5d, fig. S7d, and fig. S9, b,d,f
%% PSTH of spontaneous activity
clear; clc; close all;
evCrit = 0.5; % explained variance of fitted tuning (> 50%)
monkey = 'A'; % A for Monkey A, B for Monkey B
load(['Data_' monkey '_fixation_ev' num2str(evCrit) '.mat']);
w... |
3517252a297db46ce56b0a440c01a93ab0a0eef8a33386004474ae619b3e307b | MATLAB | 6,109 | 159 | %IMSTREAM Open an image or video stream for reading a frame at a time
%
% h = imstream(filename, [cache_len])
%
% This class creates a single interface to both streams from both videos
% and sequences of images. The interface is similar to that of MATLAB's
% VideoReader class. However, the read method can onl... |
d493a35491f33c7e66db72a05c52a28d3bc9477ab66a3e146e563964ef4aa6e6 | MATLAB | 6,109 | 251 | function dX = model(t, X, data, f_stim, start_stim, end_stim)
% Names for the state vector values
V = X(1);
P_a = X(2);
P_i = X(3);
n = X(4);
r = X(5);
s_1 = X(6);
s_2 = X(7);
s_3 = X(8);
m = X(9);
h_1 = X(10);
h_2 = X(11);... |
33eda3dfd0ca744844c564295bba46d9dd0bd5c3e51d4dbc772f9072190216bc | MATLAB | 6,115 | 283 | %*************************************************************************
%
% Created by : Phuong Le
% Date: 12/01/2021
%
%
% Input: trained HMM and seqeunce of events
% Column 1: time (min)
% Column 2: time (sec)
% Column 3: behavior with short names defined in
% abbrevia... |
ba396b4a04cca92e07b10a41862f4e25ce5c87777a4db4bdc289841b381aec54 | MATLAB | 6,118 | 121 | function [Quality, figInfo, tbl] = handmess(obj, plotName, Elec, trangeTopo, TargetOrResponse, AverageOrSlope, MorletOrsFFT, freqRange)
%% [Quality, figInfo, tbl] = plotERP(obj, plotName, Elec, plotThis, plotComb, grouping, trangeTopo, TargetOrResponse, MorletOrsFFT, AverageOrSlope)
% Similar to topoplotting in plotE... |
250e5fca5ab2f55656fb428ec8bee56096eae00778108383af6bcb1e945485a7 | MATLAB | 6,125 | 179 | classdef TrialStateTest < matlab.unittest.TestCase
% Tests TrialState
% Author: Lasse Osterhagen
properties(Constant)
firstTimerCall = 0.05;
timerPeriod = 0.25 % 2nd timer call at 0.05+0.25 = 0.3 s
maxReactionTime = 0.1;
end
properties
% ExperimentController mock object
experimentController
%... |
c6c90eb02f669479a4a086971ff1c0dabebb5c8e19e45cc601a1b5d33d065fd1 | MATLAB | 6,160 | 133 | function CPD_plots_mean(U,r_components,left,condition_ind,conditions,saveDir,tick_time,tick_freq)
%Generate a figure for each CPD component contains subplots of temporal (time),
%spectral (frequency), spatial (channels), and subjects. Plotting channels
%activations on the left and right hemisphere. Taki... |
b525f2568c484c03b1e9da32f61bc455b97b9ee2ebd97325d55c7f6c720eec02 | MATLAB | 6,170 | 160 | %---------------------------------------------------------------%
% This is the script for plotting all linearized rate maps %
% sorted by trajectory selectivity index %
% -- Wenbo Tang (Jan 06, 2023) %
%-------------------------------------------------------... |
b5fcf33ad66f97cb11299fe0e3e451c08d814178dbd09892347d9a6f96236d1d | MATLAB | 6,180 | 153 | %Author: Tatjana Schmitt 2019-2022
function FRA_analysis_combine_awake(root_path)
%%
save_flag = true;
%%
Rsquare = zeros;
FWHM_1 = zeros;
FWHM_2 = zeros;
all_BFs = zeros;
BF_single_peak = zeros;
BF_double_peak = zeros;
percentage_PT = zeros;
percentage_tuning = zeros;
tuning_overview = zeros; %... |
cae7bc4d9b8cd3d1517bfd8adc91f9ce010271de5cc3b50b8073ee0517ace52c | MATLAB | 6,181 | 130 | function file_format_data=get_file_format_vals(signal,signal_table,line_num,chan_num,line_trial_num,...
num_lines,line_trials,line_max_trials,handles)
% GET_FILE_FORMAT_VALS returns a string that consist of a number of MATLAB
% commands. These are in... |
caee2ae2e956c6084e4407aa02e0ec73204ce267b6782cb0d2f3b9002e933042 | MATLAB | 6,185 | 207 |
function A = convnfft(A, B, shape, dims, options)
% CONVNFFT FFT-BASED N-dimensional convolution.
% C = CONVNFFT(A, B) performs the N-dimensional convolution of
% matrices A and B. If nak = size(A,k) and nbk = size(B,k), then
% size(C,k) = max([nak+nbk-1,nak,nbk]);
%
% C = CONVNFFT(A, B, SHAPE) controls the... |
32cd83c3db059827b06d8486927fad10edd2deb86155c7661dfadfe61160d3b9 | MATLAB | 6,189 | 179 | function process_rat_folder(data_folder, rat_num, job_parts)
% JN 2019-01-27
% function runs one rat folder
expdata = prepare_session_folders(data_folder, rat_num);
% JN 2020-05-11
if height(expdata.rat_table) == 0
return
end
%Added by AP 240420
out_folder_rat = expdata.folders.out_folder_rat;
% process and save ... |
e10d36a11db3de12f288c3a428074b6ce6cfb306b879a572f323a54103109ed1 | MATLAB | 6,203 | 112 |
% ClinicalASL toolbox 2023, JCWSiero
%%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% written by Jeroen Siero 25-05-2023 for the MOYAMOYA study
% includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smo... |
345ebac097b31c0afea2b0149f7e6ea44d417fad93a9939950184977a9d02dec | MATLAB | 6,218 | 133 | function [model_name,Y_pred,Y_pred_3d] = generate_ml_model_prediction_pairwise(T,T_3d,data_source,sensor_feats,num_folds)
%% Input
% 'T' is the table with all data, including demographic and clinical data and sensor-based feature data;
% each row is data from a single session/sensor wear period
% 'T_3d' contain... |
6d4f691930b1ca8dd7cb5c8b72cb726d63670f783b54e9f822eeadb5758bb6cb | MATLAB | 6,230 | 208 | function fit = fit_meta_d_SSE(obs_HR2_rS1, obs_FAR2_rS1, obs_HR2_rS2, obs_FAR2_rS2, cprime, s, d_min, d_max, d_grain)
% fit = fit_metad_SSE(obs_HR2_rS1, obs_FAR2_rS1, obs_HR2_rS2, obs_FAR2_rS2,
% cprime, s, d_min, d_max, d_grain)
%
% Given response-conditional type 2 hit rates and type 2 false a... |
b0640ca33febab5b551280404ab92a9464fbfd6bc17f515d11792a2a76927e79 | MATLAB | 6,317 | 179 | %%
% This code runs multiple examples of the non-spatial network used in Handy
% and Borisyuk, 2023 with one feedforward input
%
% The examples show the default network (no astrocyte ensheathmenth) and
% three examples of the network with astrocyte ensheathment. The first two
% show synchronous behavior, and the last m... |
71c7c5075d981d80ad921bd42b1f0873185e0f92c31d32efa34eace4add0220f | MATLAB | 6,318 | 147 | classdef RatDataHandler < handle
properties
led_loc
led_size
loc
movie_serial
frame_ind
tiff_ind
full_tiff_name
tiff_handle
rat_loc_h
marker_color
collage_size
collage_ind
collage_total
collage
c... |
16d77ec112257303b30ce13d8c6e71395c8eb1e690007be440220327c7811740 | MATLAB | 6,396 | 197 | % Region Based Active Contour Segmentation
%
% seg = region_seg(I,init_mask,max_its,alpha,display)
%
% Inputs: I 2D image
% init_mask Initialization (1 = foreground, 0 = bg)
% max_its Number of iterations to run segmentation for
% alpha (optional) Weight of smoothing... |
cd82475c98e834668445a4b74c6ab9a1cdaf842a13b30194d8e1b1f17b4b451e | MATLAB | 6,411 | 267 | function [CC_All, CS_All] = simulation_cholinergic_pv(i_curr)
load('params_pv.mat');
CC_All = zeros(1,36);
CS_All = zeros(1,36);
jValues = 50:10:400;
for jdx = 1:numel(jValues)
j_curr = jValues(jdx);
%% Define noise and input
It = linspace(0,params.tfinal, params.... |
f3d665abd518ddcefb6ec2997135ff0340c4e6e6574a4b0fbefbbf5e39841f5b | MATLAB | 6,413 | 267 | function [CC_All, CS_All] = simulation_cholinergic_sst(i_curr)
load('params_sst.mat');
CC_All = zeros(1,36);
CS_All = zeros(1,36);
jValues = 50:10:400;
for jdx = 1:numel(jValues)
j_curr = jValues(jdx);
%% Define noise and input
It = linspace(0,params.tfinal, param... |
86d27ce202ead74c9a8bc1524d14793231b1c5168bcd88bd38f3eeaeb946c024 | MATLAB | 6,429 | 267 | function [CC_All, CS_All] = simulation_cholinergic_vip(i_curr)
load('params_vip.mat');
CC_All = zeros(1,36);
CS_All = zeros(1,36);
jValues = 50:10:400;
for jdx = 1:numel(jValues)
j_curr = jValues(jdx);
%% Define noise and input
It = linspace(0,params.tfinal, param... |
c1743ff41286dca752ce4b15633f71ecf45c2e045f36c177357655a8da6eda4c | MATLAB | 6,446 | 223 | % [kcMax,A0,kcGM,d0,d] = getDcorr(im,r,Ng,figID)
% ---------------------------------------
%
% Estimate the image cut-off frequency based on decorrelation analysis
%
% Inputs:
% im 2D image to be analyzed
% r Fourier space sampling of the analysis (default: r = linspace(0,1,50)
% Ng Number of hi... |
e4928523720ec58f6141404361a2e5fbb65e412851447676d0bd7f0529c85bb0 | MATLAB | 6,451 | 172 | % Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht,
% a.bhogal@umcutrecht.nl
% <convHRF2: convolved an input signal with a double-gamma hemodynamic response function (HRF) >
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public Licen... |
65203ca5c45899957738c8a15cbb3a53108d31b896217624aa336784fac74d66 | MATLAB | 6,469 | 268 | function [CC_All, CS_All] = simulation_cholinergic(i_curr,curr_length)
% Nair et al., 2020, Aditya Nair
load('params.mat');
CC_All = zeros(1,curr_length);
CS_All = zeros(1,curr_length);
jValues = 50:50:400;
for jdx = 1:numel(jValues)
j_curr = jValues(jdx);
%% Define n... |
bb0b2553d763491a15550f5ae123b29ac13f8f1f3ea3907d723675955361ede3 | MATLAB | 6,487 | 185 | % Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht,
% a.bhogal@umcutrecht.nl
% <glmCVRidx: generates internally normalized CVR maps (i.e. without using respiratory data) >
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public Li... |
02a6b98618074f1aca5a92d05c705abe457ad096960fbaf42f357972370a6106 | MATLAB | 6,534 | 142 | function [Ioutlier_allsteps, Ioutlier_step1, Ioutlier_step2, NoOutliers_logical] = ASLOutlierRemovalPerform(CBFdata4D, brainmask, outlierFactor, GMmask, WMmask, CSFmask, onlystep1)
% ClinicalASL toolbox 2023, JCWSiero
% ASL OutlierRemoval (volumes)using the SCORE method by Duloi et al JMRI 2017
%confine to brain t... |
a63257e2deb347438d55a3d3d12b863dc7fe5113deeecdcfff9bed19e19ece33 | MATLAB | 6,539 | 131 | function SUBJECT = ASLSaveResultsCBFAAT_vTRASL(SUBJECT)
% ClinicalASL toolbox 2023, JCWSiero
% copy NIFTIs to ASL_vTR folder
% M0
vTR_M0_path = fullfile(SUBJECT.ASLdir, 'vTR_M0.nii.gz');
if isunix
system(['cp ' SUBJECT.vTRM0filenameNIFTI ' ' vTR_M0_path]);
elseif ispc
system(['copy /Y ' SUBJECT.vTRM0f... |
bbaefaf660079e6182bbb5d5cee16ca68e45b87127acfa8f36e1734196cea015 | MATLAB | 6,568 | 160 | function varargout = gradient_removal_gui(varargin)
% GRADIENT_REMOVAL_GUI MATLAB code for gradient_removal_gui.fig
% GRADIENT_REMOVAL_GUI, by itself, creates a new GRADIENT_REMOVAL_GUI or raises the existing
% singleton*.
%
% H = GRADIENT_REMOVAL_GUI returns the handle to a new GRADIENT_REMOVAL_GUI or t... |
2622e27b424148d2f3daf9a740d2a342ead0ac0481395db8102d2700ff305ce8 | MATLAB | 6,607 | 206 | %%
% Simulation results for the non-spatial one population model for networks
% with and without astrocyte ensheathment
% Creates Figures 3 and 4
%%
%% Figure 3: Plot the raster and rolling average plots
% Load the data raster plot examples
load('./CompressedData/NonspatialOnePop/balancedCompressed.mat')
load('./Compr... |
7b919bc4092e896b065a607fe0fbaebe52621d235d87eee450ad7576cdce3b5a | MATLAB | 6,611 | 154 | clear all; close all; clc;
addpath('.\\Utils');
%% PART 1
% ---- This file contains the following sections:
% 1 ----- output cropped psf stack from .txt file generated from zemax
% 1.1 ------ import .txt data and tranform to .mat (,tiff for show)
% 1.2 ------ first downsample to align DELTA(zemax) with the sensor pixe... |
5f4b83f6f8b2c5eef2c271d656d0b8d2c9e9333b9a5a0d484c00c7864648ebf3 | MATLAB | 6,612 | 111 | %create objects from masks and export to fcs for ez_segmenter
function create_objects(point_index, pipeline_data)
%% Pre-processing steps to mask data, convert into fcs / csv usable format, and create attributes to be saved later
% get point from provided index
point_names = pipeline_data.points.getNames(... |
10006b8789664db5b89f675b7b5a4ac4b3f78ba782eafc46d3e2fb83fcb47399 | MATLAB | 6,624 | 165 | function [ctxidx, hpidx] = matchidx_acrossep(animaldir, animalprefix, day, exclude_list)
eps = [2 4 6];
%%
tetinfo = loaddatastruct(animaldir, animalprefix, 'tetinfo');
cell = loaddatastruct(animaldir,animalprefix,'cellinfo');
spks = loaddatastruct(animaldir, animalprefix, 'spikes', day); % get spikes
%%
for ep = ep... |
90e4fed0b4b33bbb1813cef4556194c6937ff9b4b95f4c4a4e160b0186e8381a | MATLAB | 6,657 | 259 | % This code is a modified version of the original code from Mante et al 2013.
% V. Mante, D. Sussillo, K. V. Shenoy, W. T. Newsome,
% Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature. 503, 78–84 (2013).
%% Add paths
clear; clc;
% TDR path
tdrDir = ''; % put your code directory
addpat... |
a7cee442ef69e3cb39b66ad12e1236c130cc536cd5388515f21fc5e12d14928c | MATLAB | 6,673 | 181 | %% This script creates an xml to tile a large rectangular area
% Author: Dmitry Tebaykin
% dmitry.tebaykin@stanford.edu
%% SCRIPT INPUTS
% outputFileName - the output xml file path
% inputFileName - the input xml file with single point coordinates
% horizontalJog - the amount of movement during a horizontal step in ... |
d9768ff8ed829cd37318ceb1c7974cf7516b90096565e7b9a77207a6954365ef | MATLAB | 6,683 | 171 | %% Transitioned to full script, if needed as a function - uncomment the next line
% function MibiWriteTilingXmlCenterRect(outputFileName, inputFileName, xNum, yNum, xJog, yJog)
% Add this line in command window MibiWriteTilingXmlCenterRect('outputFileName.xml','inputFileName.xml',NumRows,NumCols,xJog,yJog)
% example: M... |
678ad77f970c78874074f798520a45506301108292dab20859366b03127271e3 | MATLAB | 6,702 | 201 | function out = type2_SDT_SSE(input1, input2, input3, input4, input5, input6)
% out = type2_SDT(input)
%
% Given data from an experiment where an observer discriminates between two
% stimulus alternatives on every trial and provides confidence ratings,
% provides a type 2 SDT analysis of the data.
%
% The funct... |
c3d2764d9340d0d637bc04cdd9f814731a6325f85103516828b8b9bab1e9e7f9 | MATLAB | 6,709 | 194 | function z = zernfun(n,m,r,theta,nflag)
%ZERNFUN Zernike functions of order N and frequency M on the unit circle.
% Z = ZERNFUN(N,M,R,THETA) returns the Zernike functions of order N
% and angular frequency M, evaluated at positions (R,THETA) on the
% unit circle. N is a vector of positive integers (including... |
ca8c54a08fb63a37339dc1deb6d07b5af786b19ce70c1de5039fa73ac8f56216 | MATLAB | 6,710 | 152 | function [output_db] = parse_camera(rat_dir)
% Function parse_camera() reads the camera_analyzed_data.mat that is produced by the pipeline.
%
% Inputs:
% rat_dir - (str) - Location of the camera_analyzed_data.mat, inside the experiment folder
%
% Outputs:
% output_db - (struct) - ... |
fab051c001fa9aa6c051e6288de5194358ffc722b7fbdb49cbc7f8b994fdacd7 | MATLAB | 6,714 | 195 | % Create a function to binarize and detect blebs from individual dendrite
% regions
% Now removes blebs from the dendrite thickness
% Breaks are removed by finding '0' widths
function [width1] = findDendriteWidth(dendimg,dend1img,imFeatures,sFactor)
% Remove detected feature from dendrites
imRmv = imdilat... |
1f79c10e497dcfb3cd5cf290c6407ee93e4ee7c9e3096a97d15b7b3f3927b831 | MATLAB | 6,722 | 174 | function gramm_dCOS_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;
%% Grab Monoc and Diop... |
a361f149da49afd8118c82479d6996ee6c80a9311bcf29007058602523cfcdd7 | MATLAB | 6,736 | 171 | %---------------------------------------------------------------%
% This is the main script for plotting the confusion matrix %
% -- Wenbo Tang (Jan 05, 2023) %
%---------------------------------------------------------------%
clc;
clear all
close all;
%%
animalprefix_list = {'AM2',... |
f8fa40add35af20c45b94efdb61e67652083159018e1696e94a2c3abd0fb9efe | MATLAB | 6,776 | 219 | clear all;
c1 = [121 180; 136 180; 151 180; 166 180]; % window before ME, 1s = 30units
c2 = [181 240; 181 225; 181 210; 181 195]; % window after ME
load('ri.mat'); load('rr.mat')
crossN = 4; repeatN = 1; sampleN = 400;
%% rr reward or not
i=0; rrRw={};
for ci=1:size(c1,1)
ci
% for cj=1:size(... |
2b90485d4df45d9c23d6730fafddda220b3e651b25ef909cb89223d7427d64c5 | MATLAB | 6,787 | 225 | function [rsq_simult,rsq_adapted] = visIDX_scatterRESPocc_binnedOcc(IDX,flag_SaveFigs)
%% Goal
% 2 plots; dII index vs occ.
% plot 1 - simult
% plot 2 - adapted
%% Initial variables
conditNameForCC = IDX.allV1(1).condition.Properties.RowNames;
uctLength = length(IDX.allV1);
% B. pull out all laminar matrices 3x... |
761ab4b07796c3369ea1a071d43da16fc51ea6f6b60e32435cc5fecf7949f8ca | MATLAB | 6,787 | 167 | classdef Embedding < handle
%Embedding
% Diffusion map representation of an adjacency matrix
properties (SetAccess = private)
EigenValues
EigenVectors
SymmP
Emb
t
Method
Threshold
Elbow
end
methods(Access = private)
... |
d033d9ee2302635d30cf82bb0a6a47ab9d0d5bc24d9ee91336c4c1884bdefcbf | MATLAB | 6,791 | 221 | function [obs_Ag, exp_Ag, ROCpoints] = type2ag(nR_S1, nR_S2, eqvar, doPlot)
% [obs_Ag, exp_Ag, ROCpoints] = type2ag(nR_S1, nR_S2, eqvar, doPlot)
%
% input
% nR_S1, nR_S2 : response counts for S1 and S2 stimuli
% eqvar : 1 if assuming equal variance SDT model, 0 otherwise (requires
% SDT_MLE_fit)
% doPlot : Plot... |
25982196cbb820a453ad096c40b911141ee74418b1a3c5d698fd6deb4c90ce12 | MATLAB | 6,795 | 219 | clear all;
c1 = [121 180; 136 180; 151 180; 166 180]; % window before MX, 1s = 30units
c2 = [181 240; 181 225; 181 210; 181 195]; % window after MX
load('ri.mat'); load('rr.mat')
crossN = 4; repeatN = 1; sampleN = 400;
%% rr reward or not
i=0; rrRw={};
for ci=1:size(c1,1)
ci
% for cj=1:siz... |
ef68acf800231794a91266ff72e8257fbc5b2fbc008c9fff77c19e22bf7ac2de | MATLAB | 6,813 | 186 | % Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht,
% a.bhogal@umcutrecht.nl
% <convHRF2: convolved an input signal with a double-gamma hemodynamic response function (HRF) >
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public Licen... |
d45bf89869903839c24c5079f615f8d8990d17f7928c038f62d8be1a1ad29946 | MATLAB | 6,878 | 111 | %% LaBGAS_create_first_level_CANlab_tools_folder_structure
%
% This simple script
% 1) creates the folder structure for first level analysis using CANlab tools
% 2) copies noise regressor and onset files generated by
% LaBGAS_extract_confound_reg_fMRIprep.m to run-specific directories in
% 'derivatives\fmriprep' as t... |
84a97bdd1506be4e31f5412590a83f8c69ae92c70e318f64fb1614ec3213a03c | MATLAB | 6,884 | 184 | % script to compare the ACC of classifier (OBIWAN FIX classifier) with
% hand classification
%% input variable
clear all
myclassification = 0;
subX = 'obese202';
sesX = 'third';
%taskX = 'pavlovianlearning';
%taskX = 'PIT';
taskX = 'hedonicreactivity';
cd ~
home = pwd;
homePath = [home '/OBIWAN/'];
%% define pat... |
dc98122252027cd69606adff733e35576070c6f6ba708ded3bf76f13d7a09fe9 | MATLAB | 6,894 | 159 | function gramm_dCOS_RESP(IDX)
%% Goal
% use gramm and plot the simultaneous congruent, incongruent, and monoc
% preferred.
% line plots using "methods for visualizing repeated trajectories"
%% Grab Monoc and Diop/Dichop, but only if conditions are balanced per unit
conditNameForCC = IDX.allV1(1).condition.Properties... |
53b3f2138ed80863474b44826b2c59ddb4de596324acb5c6d9fb8ebc4f8e0312 | MATLAB | 6,912 | 141 | function [new_data, new_y0] = step(data, y0, eta)
new_data = data;
new_data.V_uni_max = new_data.V_uni_max*exp(eta*randn(1));
new_data.psi0 = new_data.psi0*exp(eta*randn(1));
new_data.K_act = new_data.K_act*exp(eta*randn(1));
new_data.K_trans = new_data.K_trans*exp(eta*randn(1));
new_data.L = new_data.L*exp(eta*r... |
8c2423ab283a6f2b8028d9823bfc2bbcd90704054ecdc1b4e9991447a0ee8909 | MATLAB | 6,926 | 221 | classdef ExperimentController < handle
%EXPERIMENTCONTROLLER controls the execution of an exerimental session.
% It controls the interplay between AudioPlayer, AudioObjectGenerator and
% InputOutputDevice.
% Author: Lasse Osterhagen
properties (Access = private)
% I/O device
ioDevice
% AudioPlayer as ... |
6893a31cd7725c58946a6d354b2913ab663f2c581e8758d6045b90d89f51732f | MATLAB | 6,938 | 179 | %IMSTREAM Open an image or video stream for reading a frame at a time
%
% h = imstream(filename, [cache_len])
%
% This class creates a single interface to both streams from both videos
% and sequences of images. The interface is similar to that of MATLAB's
% VideoReader class. However, the read method can onl... |
3c92c728c1462f7237c9573ebe3544a3831031cab416129a53dd9fda0511f040 | MATLAB | 6,963 | 177 | %--- Script generating figure 4 ---
%% Initializes everything
clear, close all
run StartupAnalysis
rng(1949)
%% Sets Figure parameters
% db1FigSize = [100 100 1600 900];
db1FigSize = [50 50 1200 600];
iFig = 0; hFIG = [];
%% Sets time parameters
inSRate = 1000;
dbWinSec = 0.5;
inTrain... |
f7c35ea761bbea99f920d4587233a4221c30010ff25ae8a28dbd4e9556ba5939 | MATLAB | 6,996 | 148 | %%% Script to compute the output measures of the Computational Model Drave article of the experimental data.
% It takes raw data files in .mat format, goes through the wells, detects spikes at every electrode,
% computed bursts and then computes the related output measures
%%% Nina Doorn - n.doorn-1@utwente.nl - 1... |
def33efca5b1567ad91e162006ee29934e86f0289bf34c6e793cc8d802521983 | MATLAB | 6,999 | 182 | %IMSEQ Open an image sequence as if it were a video stream.
%
% h = imseq(filename)
%
% This class creates an interface to a sequence of images similar to that
% of MATLAB's VideoReader class. However, the read method can only read an
% image at a time.
%
% There are two ways of defining the files to be use... |
ec41f6b255269b4917ebfe20e79949f9e18a2a70cfc3865d5060ffb6f7a31250 | MATLAB | 7,102 | 147 | function [SpatMap,CaSignal,width,height,contour,Json] = CaImSegmentation(VideoFileName,maxNeurons,estNeuronSize,AR_p,maxITER)
%CaImSegmentation.m
% See Pnevmatikakis & Paninski, 2014 & 2016, for their matrix factorization
% algorithm to automate image segmentation for calcium imaging data.
% Briefly, if d... |
51537ec89d3073bf1aba2f904f6e9d950f0bb5e55e43aec177efd47978e6f971 | MATLAB | 7,111 | 178 | function chans_tables= get_channels_tables(line,rnd_builder)
% GET_TABLE returns a cell array of size 4 where each cell holds a tables of
% values of the specific channel. Each such table holds values of all
% components of the signal in the given channel.
% CHANS_TABLES=GET_TABLE(LINE,RND_BUILDER) returns a cell arra... |
ff9d7f4ea2be3711ca32f46708e0350bc54bf81841b70ceb811c7192d671e6f6 | MATLAB | 7,120 | 187 | % script to compare the ACC of classifier (OBIWAN FIX classifier) with
% hand classification
%% input variable
clear all
myclassification = 0;
subX = 'obese242';
sesX = 'second';
%taskX = 'pavlovianlearning';
%taskX = 'PIT';
taskX = 'hedonicreactivity';
cd ~
home = pwd;
homePath = [home '/OBIWAN/'];
%% define pa... |
12bda066a7be85e9a17cb5d7a7fa9af2ceb8ab81200b6720374ff0f82bae8fbd | MATLAB | 7,148 | 171 | % Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht,
% a.bhogal@umcutrecht.nl
% <genGS: GLM based approach to regress out nuisance and data signals in provide residual timeseries data >
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Gen... |
207ddb87634cecdf4f9ef4ec9a622206d4ef17841583941b4775f4793581d2e9 | MATLAB | 7,173 | 277 | % This code is a modified version of the original code from Mante et al 2013.
% V. Mante, D. Sussillo, K. V. Shenoy, W. T. Newsome, Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature. 503, 78–84 (2013).
%% Add paths
clear; clc;
% TDR path
tdrDir = ''; % put your code directory
addpath(f... |
dc4475307ac49b06b40dcb9666bf5a8a8935978af9c02d13ff675a9b9b3df641 | MATLAB | 7,221 | 129 | % This script is to apply between-subject analysis for all the conditions and
% for each hemisphere separatly. Using the data filtered using 0.1Hz LPF.
% In this version, time-frequency matrix was added to the tensor.
% This runs a non-negative CPD.
% This has different components for the left and right hemisphere... |
0ada689fa31021da7aeb494fde4a8d8b0db2ef48b8d568950a8ae188915e29bd | MATLAB | 7,258 | 186 | classdef ContinuousBgndAudioPlayer < PsychPortAudioPlayer
%CONTINUOUSBGNDAUDIOPLAYER playes stimuli in continuous background sound.
% The background (masker) sound comes from a SampleSource object.
% Sound samples for AudioObject classes will be generated by
% appropriated AudioObjectSampleFactories. These have ... |
dc8721b8728144411047848c2596af880fff2c75aefd1a185a8a17d02ba6cfae | MATLAB | 7,265 | 254 | function violinPlots(IDX,flag_SaveFigs)
%% Goal
% lets try out all of the gramm plots under the gramm heading:
% Methods for visualizing Y~X relationships with X as categorical variable
% Ultimately I think I really want the violin plots.
%% Build DataForVis structure
% esentially taking IDX and turning it into... |
7bd6f636f618f0f95e0376217a2e51243605c5fe6bcb976d194aa79774fe626d | MATLAB | 7,431 | 225 | function [ subject ] = nmri_align_mri(subject, params)
%[ subject ] = nmri_align_mri(subject, params)
%
% This function will do (interactive) MRI alignement to CTF
% and also define the SUMA dir
%
%
% subject = subject structure, see nmri_read_subject
% could be a struct or .m file or .mat file
%... |
4c87535646a0eaef0717e58d75e7c33f28840bae06df34e239d25d7b3a890117 | MATLAB | 7,439 | 176 | clear;clc
% load predictor vairables, regional gene expresseion
gene_regional_expression = importdata('\demo\input\gene_regional_expression_zscored.mat');
Y_data = importdata('\demo\input\Ydata.mat'); % load response variables
Y=Y_data; % Response variable
% z-score:
Y=zscore(Y);
outputDir = '\demo\output';
... |
14c9218280c37f4039ee082635dde03bf0f7a3f692b6bbd7b0b2855041425f4e | MATLAB | 7,458 | 146 | function [wedge, bandpass, lowpass] = SLgetWedgeBandpassAndLowpassFilters2D(rows,cols,shearLevels,directionalFilter,scalingFilter,waveletFilter,scalingFilter2)
%SLgetWedgeBandpassAndLowpassFilters2D
%% check number of input parameters and assign default values
if nargin < 3
error('Not enough input parameters!');
e... |
c915059cde8ea0447dcbfd8d0d6f5bed4b015bebcb7ffd1dda2ebe45b82f999b | MATLAB | 7,479 | 239 | function [data_avg,data_sub] = tdrAverageCondition(data,task_index)
% tdrAverageCondition compute condition averaged responses
%
% Inputs:
% data: population response (sequential or simultaneous, see 'help tdr')
% task_index: indeces of task variables to average.
%
% e.g. task_index.stim_dir = [1 2 3]
% ... |
50e0c8af5e8c283bd91e966082ebb55e714c0a96f5628e5bbdb243445f1cc5a8 | MATLAB | 7,494 | 182 | classdef ToneStimulusSampleFactory < AudioObjectSampleFactory
%TONESTIMULUSLEVELSAMPLEFACTORY creates tones in continuous background sound.
% This class is an AudioObjectSampleFactory that inserts tones in a
% continuous background sound (e. g. white noise).
% It can only create samples for ToneStimuli from a fix... |
ee464851f4e48130b77d59ded82174b0bf0dae6449dd0dc48fe9f31dcfc13249 | MATLAB | 7,505 | 153 | function filename=preproces_functional4all_spm(subjectdir, filename, fsldir, diratlas, bet, sm)
% starts functional brain preprocessing
% realgin all functional scans
% This section is using FSL's MCFLIRT tool to conduct
% motion correction and then plotting out and saving the motion
% parameters as a separate JPEG f... |
adbfe97c74159780fac04aa50382c59fffded3ccf07452e385b2c8c4b9e2c67d | MATLAB | 7,523 | 364 | function [LOCS,VALS]=fb_compute_peak(CA_DATA,varargin)
% Computes the peaks for a calcium trace or series of calcium traces
%
%
%
% algorithm: schmitt trigger, double exponential fit (for now)
%
%
thresh_hi=1.2;
thresh_lo=-1;
thresh_t=.1;
thresh_int=8;
fs=22;
method='p'; % f-min, simulated annealing, pattern search,... |
a6de30e1fe5009a365e4658db413cd7d886aaae76b2c6fd498dd1a29927be89d | MATLAB | 7,552 | 258 | function StimulusList(fs,bf)
% S a structure containing the sound sequence and its parameters
% sig: the sound sequence
% Properties of each sound sequence played:
% type: BBN / sine (=SSA or FS) / gap / silence / file (=food/water)
% speaker: the speaker it will play from, for now = 3
% trial_dur: in ms, usually 500 o... |
e39cec6a5169aca6ab0a965aae17cb490257cb67d42601a237afcaf33af6238b | MATLAB | 7,564 | 166 | function send_msg(recipients, subject, message, carrier)
% SEND_MSG sends email or text messages to cell phones or other mobile devices
% assuming that you are sending from a Gmail account.
% Text messaging is currently supported only within the US.
%
% RECIPIENTS is a cell array indicating the emails or phon... |
18cfaea966e3dfd9c98c467ba20febbb8c0b8dde8719e710892ec41d2891630b | MATLAB | 7,590 | 190 | function append_pdfs(varargin)
%APPEND_PDFS Appends/concatenates multiple PDF files
%
% Usage example:
% append_pdfs(outputFilename, inputFilename1, inputFilename2, ...)
% append_pdfs(outputFilename, inputFilenames_list{:})
% append_pdfs(outputFilename, inputFilenames_cell_or_string_array)
% append_pdfs ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.