sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
494866467dcdf392ea2b61bea17038acb3d5abdf0c713ba7f060bad2bb49c449
MATLAB
1,143
35
function [Final_img, m_Weight] = MIRO_Aggregation(similar_blocks, Wiener_weights, blk_positions, m_final_img, m_weight_img, Count, Kaiser, D, beta)%#codegen shape = size(similar_blocks)-1; Wiener_weights = (Wiener_weights).^(beta); block_weight = Wiener_weights.*Kaiser; pad = [8,8]; blocks = zeros(shape(2)+2*pad(1)+...
8cc243651d64afe9f79bdfe99c2cd30b259727bf4beb551078ad46726207a471
MATLAB
1,143
41
function d = pdist1(arr) % PDIST1 calculates distances passed between every two consecutive time points in the given vector. % Input: % arr - array of [n x 2] points. % % Output: % d - array of length as input 'arr', dimension as input. First value is 0. % % Usage: % >> d = pdist1([x y]) % ==========...
cf33d753a631921cbb945b12fcc151355b974249367b440e5d55084e2578493c
MATLAB
1,149
39
function complete = makeGapThresholdExp(gapDurations, delays, trialFac, ... shamTrialFac) %MAKEGAPTHRESHOLDEXP creates an experiment with gap stimuli. % Arguments (defaults in square brackets): % gapDurations - an array of the set of gap durations % delays - an array of the set of start delays [1.25:5.25] % ...
91acdd2b84d9b915438fc3f07eb96e6ab89d4c9c3d0d1f0f17229ab7d5911f82
MATLAB
1,150
29
function [minerrtype, minerr] = classify_type(X,centroids) % INPUT: % X(Nsegm,Nfeat) contains calculcated and preprocessed features for N segm of data % centroids(Ntype,Nfeat) contains centroids from clustering features from some sample of data if size(X,2)~=size(centroids,2) error('different amount of feat...
eedc53eb0de28c809ba48f91d99475eeaf4d37864361733e80232fa0cfa4fd04
MATLAB
1,154
41
function [T, paramF] = createPureToneLine(Told, paramFold, att, freq, nstims, speaker) type = cell(nstims, 1); type(:) = {'freq'}; type = categorical(type); % speaker = ones(nstims,1)*3; speaker = speaker'; samp_rate = ones(nstims,1)*192000; trial_dur = ones(nstims,1)*500; stime = ones(nstims,1)*200; etime = ones(nsti...
01102c577ac3a88b922c84649bf86c34df2576d035622c3d45bc2930215ff070
MATLAB
1,155
26
function generatePanels_FigS4(FigS4) %% Constants p10Maps(1,:)=FigS4.constants.colormap(3,:); p10Maps(2,:)=FigS4.constants.colormap(2,:); p10Maps(3,:)=FigS4.constants.colormap(1,:); p10_ArousalStates=fieldnames(FigS4.P10.Histograms); p15_ArousalStates=fieldnames(FigS4.P15.Histograms); %% P10 Log-EMG Power in s...
36f25cc7082be36e681516d628c417bb001e306a8ecd835e2afa00fbd6adbd09
MATLAB
1,165
43
%PINK Black-pink-white colormap % % Examples: % map = pink % map = pink(len) % B = pink(A) % B = pink(A, lims) % % Similar to MATLAB's pink colormap, but the function can additionally be % used to convert a real-valued array into a truecolor array using the % colormap. % % IN: % len - Scalar len...
544990ecf1ea94344d8e0b1a408b2c2f39e3c00c527b9ebb5e9c50b0a3e8c8ba
MATLAB
1,165
94
figure(); colores = {'r','g','b'} counter2 = 1; clear HoldingV; cf = [1 2 3] for c = 1:3; color = colores{c}; counter2 = 1; HoldingV = []; roi_ave = ROI_dat{cf(c)}; for trial = 1:size(roi_ave.raw_dat,2) clear Y; counter = 1; for i = 1:size(roi_ave.interp_raw,1) HoldingV{i,counter2...
0bc1ace8601b120968696239eff98a51be96463cb0c9695a6b1307410bd4a4fe
MATLAB
1,167
30
%Author: Tatjana Schmitt, 2019-2022 function edges_turning_points_maps = edges_turning_points(BF, radial_vectors_mean_BF_smoothed, borders) % creates images for edges and turning points with 1s as borders edges_turning_points_maps = cell(1, size(borders.turning_points,2)+1); for j = 1:size(edges_turning_points_ma...
3f2f1873aa3f3ea2452c25954ce523c3f8ee6f6e55c32eaafe47d063f51b956e
MATLAB
1,168
33
function write_trial_data(out,line_num,trial_num_in_line,trial_num) fid=get(out,'Fid'); if fid==-1 return; end % meta=get(out,'Metablock'); meta=get(out,'StimList'); % line=get_line(meta,line_num); % signals=get(line,'Chan_signals'); % total_trials=get(meta,'Num_of_trials'); total_trials = height(meta.T); fprintf(...
c21b02c785e99883f880a7453bf60d6643aa6744e3dce4d80e65323ad14e780b
MATLAB
1,168
46
classdef MemFunctor < handle %MEMFUNCTOR saves arguments and results of function calls % MemFunctor is a kind of decorator for a function. The constructor takes % a function handle to a primary function. A call to func() replaces the % primary function. Beyond providing the same functionality as the % primary f...
49ba0f2377f029647851352d7a50ceb0b3a58bbd18b1810a4385fd3a31710398
MATLAB
1,169
29
function color_array = ColorRGB_ForPlot(color_indx) % This is a small function which saves 6 different colour schemes used for % the R2* paper (and other papers). The first three are for in silico data % at variable g-ratio, while the next three are for ex vivo data at % variable fibre dispersion. The last three ...
d26c99c19867b1112664a8b8f1ff995069ccbcdb1cd73527684d7276f7d432b7
MATLAB
1,171
35
function meta_info=get_meta_info(meta) % GET_META_INFO returns information on the MetabBlock object. % META_INFO=GET_META_INFO(META) returns information on the MetabBlock object. % Each row represents a different line of the MetaBlock where each row hold the list of % signals defined for that line in each of the fourt...
4ddc18dd62adcabf52cce67f367af62b22aed09af1254297da0801652e5fca92
MATLAB
1,172
47
%Corrected for lower weights between EI function mat = create_matrix(E,I,EE,EI,IE,II,R,gamma) tot = E+I; EEmat = create_submatrix(E, E, tot, EE, R, gamma, 0); EImat = create_submatrixEI(E, I, tot, EI, R, gamma, 1); IEmat = create_submatrix(I, E, tot, IE, R, gamma, 1); IImat = create_submat...
77384ea94599e270a9d3fc67c745cbe8da1f1286cc0b08f96ca89a02d8db0f68
MATLAB
1,173
42
function init_logfile(folder) % JN 2019-03-06 % % get the current git commit ID of the code if isunix [git_hash, has_uncommited] = get_riff_git_id(); [~, hostname] = system('hostname'); [~, username] = system('whoami'); else git_hash = 'git_hash_not_available'; has_uncommited = 'git_commits_not_av...
8199a5178d48009c8d0b7b0c8bd256b1cbd8c30648b1233a280c07ad3664e2a7
MATLAB
1,174
42
function debud_tracker(frame, bg) dI = frame - bg; dI_thr = dI > 2^7; track = regionprops(dI_thr, 'Centroid', 'Area','PixelIdxList'); [a, ind] = max([track.Area]); center = track(ind).Centroid; disp(['Max area: ' num2str(a)]); [x,y] = ind2sub([960 1280], track(ind).PixelIdxList); d...
093c92db960472aef4e92860ae1b2c30ace64f0363e67a4d091218f36300e01a
MATLAB
1,177
41
% Create two files: xml table of all points and their coordinates for the % given run; png figure of connections between the points % % Author: Dmitry Tebaykin % Contact: dmitry.tebaykin@stanford.edu function MibiDrawDirection(inputFileName) %% read input xml textXML = fileread(inputFileName); paramNames= {'XAttrib', ...
bbc699b5ae0cbfd4ea9c47f69c6deabe8883dd83bf9716ea10dbe062d06773b7
MATLAB
1,178
31
% Checking Nyquist rule that the largest frequency that is part of % the line is not above 45% of the sampling rate. function check_result=check_nyquist_rule(line) right_ear=get(line,'Right_ear'); left_ear=get(line,'Left_ear'); samp_rate=get(line,'Samp_rate'); signals=get(line,'Chan_signals'); max_found=0;%the maxim...
9fdcda8d3a161c86d7980d094231291495da20eb5ef394db34dcc5ba6dd96a7a
MATLAB
1,179
51
function mAO_init_hardware global mAO % Init hardware connection [u,s]=memory; disp(u) clear u s disp('Starting SnR connection'); connect = AO_startConnection(mAO.DspMac,mAO.PcMac,-1); [u,s]=memory; disp(u) clear u s for j=1:100, pause(1); ret=AO_IsConnected; if ret==1 disp('Successfuly connected to...
4b39f6a4c4aad1afdc9172e2176506ff91e7b97afa8950b6bb8cd32aa5a742f8
MATLAB
1,185
30
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <import_respfiles: 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 ...
66b606e87213ee9fa0b0c2af981ab9d6b039bf2e08f33a7d790c6cc97fc55503
MATLAB
1,191
37
function [ dmap ] = dataDensity( x, y, width, height, limits, fudge ) %DATADENSITY Get a data density image of data % x, y - two vectors of equal length giving scatterplot x, y co-ords % width, height - dimensions of the data density plot, in pixels % limits - [xmin xmax ymin ymax] - defaults to data max/min...
303a644fda07d3b8148b3f57ab5a66ea997cc1a1d0b6985ba38ac42405d413cb
MATLAB
1,193
44
function stimDir = createStimulusDir(handles) %sounds, % stimdir : sound type (attention, reward, none) | area in which it's % played | line in stimulus list % area = (1:areaN)'; type = []; area = []; stimlistLine = []; names = categorical({'att';'target';'reward';'negative';'warning';'safe';'punish';'silence'}); %...
28dcf39542ade514cb03daf689b56be88f85e0c337bbdd4db42dc0d86e4f8fbc
MATLAB
1,195
32
function samp_points=synth(sig,samp_rate,trial_dur,varargin) % SYNTH is lowpass 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. switch nargin case 4 params=varargin{:}; if ~(ise...
73489d69f8c0e1ac30a8cb24254ed6ebe6f1bc8cfd45e259120e85fa91e732bc
MATLAB
1,195
28
function [] = MIBIloadAndDisplayBackgroundChannel(reuseFigure) global pipeline_data; point = pipeline_data.points.get('name', pipeline_data.background_point); countsAllSFiltCRSum = point.counts; labels = point.labels; bgChannel = pipeline_data.bgChannel; capBgChannel = pipeline_data.capBgCh...
1fed1f9c4f6a907a10714543973eb43cf994f9ad27664d3c23fc0445f922d20b
MATLAB
1,198
23
function genSubjSpaceVTK (in_prop_surf_byu,in_xfm,in_disp_inout,out_subj_surf,out_subj_surf_vtk,out_subj_surf_inout_vtk) %read in warped template %in_prop_surf_byu='~/graham/scratch/test_surfmorph/surfmorph_dev/work/iter1/sub-CT01/propSurface_seed_nii.byu'; %in_xfm='~/graham/scratch/test_surfmorph/surfmorph_dev/work/s...
8788e8cc152ace106240c8104cc2986d6e9455f85ceaad11beb66eb6969cd320
MATLAB
1,198
48
%generate_Figure3A clear % Parameters drift_rate = [.3 .1]; drift_rate_var = 1; bound = 100; % Initialize trial-specific variables time = 1; continue_accumulating = 1; for i=1:2 for j=1:2 process{i,j} = 0; end end % Accumulate evidence until one of the accumulators reaches the bound while process{1,...
a44601069fa6945bc2da660fb88a9c17507b3b2dbfb907c700891e71baa93fb5
MATLAB
1,199
34
function mAO=AO_manager(handles) global LFPSampRate; mAO.num_elec=handles.num_elec; mAO.LFPChannels=handles.LFPChannels; mAO.LFPSampRate=handles.LFPSampRate; mAO.SEGChannels=handles.SEGChannels; mAO.SEGSampRate=handles.SEGSampRate; mAO.TRIGChannels=handles.TRIGChannels; mAO.TRIGSampRate=handles.TRIGSampRate; mAO.LFPdat...
bbd5176c9280adc3f9792740e6285e9159149a1a497d62c04e51a3314f319667
MATLAB
1,199
33
function figure_size = getnicedialoglocation(figure_size, figure_units) % adjust the specified figure position to fig nicely over GCBF % or into the upper 3rd of the screen % Copyright 1999-2010 The MathWorks, Inc. parentHandle = gcbf; convertData.destinationUnits = figure_units; if ~isempty(parentHandle) % If t...
cbed07b7fa3667d56727063cdea1e10c643ffe9eed6acda06b0b5be617a6fed0
MATLAB
1,200
38
function s_coord = Sig_coordinator(varargin) % SIG_COORDINATOR class constructor. % S_COORD = SIG_COORDINATOR(MAIN_SIGNAL) constructs a Signal Coordinator % for the given Main_signal. switch nargin case 0 s_coord.m_sig=Main_signal; coord=Coordinator(s_coord.m_sig); s_coord=class(s_coord,'Sig_coordinator',coo...
d5b353b1b5726ff0a5631d6750e221bbd606125de835f598a4dd643aa27e3b9b
MATLAB
1,203
77
function ROI=fb_roi_detrend(ROI,varargin) % % % % % % % parameter collection nparams=length(varargin); dff=1; fs=22; win=.4; per=8; medfilt_size=.4; method='prctile'; % 'prctile','medianfilt','mean','fft','highpass' if mod(nparams,2)>0 error('Parameters must be specified as parameter/value pairs'); end for i=1:2:...
7cbae868d82784928284cf4ab2315161b6d4acf40ea6c24054e269f024240c22
MATLAB
1,204
30
%% Demo for the CocoApi (see CocoApi.m) %% initialize COCO api (please specify dataType/annType below) annTypes = { 'instances', 'captions', 'person_keypoints' }; dataType='val2014'; annType=annTypes{1}; % specify dataType/annType annFile=sprintf('../annotations/%s_%s.json',annType,dataType); coco=CocoApi(annFile); %...
61680cdbbcc6932ea41f320cf3b6bd104454d0074c55160b7e9de69d0831d0b8
MATLAB
1,210
42
function result_table = find_onset_shift_strig(ts1, ts2, use_window) % JN 2019-07-01 % simple function that uses the 'diff of diff' statistic to find the best % onset shift of two time series % script assumes that ts1 and ts2 are in seconds % use_window is the time to be used at the beginning of the session, in % se...
c7a33b3468aba6f697711aceb396f1b7f5c6fb66da7ff97650ca21191271893d
MATLAB
1,215
41
function paddedArray = SLpadArray( array,newSize) %SLPADMATRIX Summary of this function goes here % Detailed explanation goes here padSizes = zeros(1,length(newSize)); S.type = '()'; S.subs = cell(1,length(newSize)); for k = 1:length(newSize) currSize = size(array,k); sizeDiff = newS...
bdc90a406398ec5d7dc48a9fa7f427e6a46c6ae560a489f8c8bcd23ebe6efd2d
MATLAB
1,216
46
function [snr_times, to_add_all] = AO_monotonize_timestamps(snr_times) % JN 2020-05-08 (75 years Victory in Europe) % make sure file is sorted by file number already if ismember('DatedFromFileNo', snr_times.Properties.VariableNames) sort_column = snr_times.DatedFromFileNo; else sort_column = snr_times.FromFile...
fda49053a29153b6205cb83d3449c872fa184049c42d06cc8412a898cc2fecd8
MATLAB
1,218
45
function [Z_MIP, phi_MIP, Zs, phis] = MIP_Exhaustive( probs, options) %----------------------------------------------------------------------- % FUNCTION: MIP_Exhaustive.m % PURPOSE: Find the Minimum Informamtion Partition by the exhaustive search % from probability distirubtions % % INPUTS: % see MIP_search_probs %...
4fba240c6a82070e9ca6f5b21ac8878f94fb671fd538cbf320fc611817d2f8cc
MATLAB
1,219
51
function prep_for_fig06BCDEF(e2e,e2o,o2o,o2e,N) color = lines(7); hold on plotCI(e2e,color(1,:),2); plotCI(o2o,color(5,:),2); plotCI(o2e,color(3,:),2); plotCI(e2o,color(7,:),2); plot([0 25],[100/3 100/3],'k-') events = {'BPR','LED','RLS','TCH','HLD','REW','WDR'}; set(gca,'xtick',(1:4:25)-.5,'xticklab...
6ea8ce84dd643b53ee69975e7511cde65dced08c9e68456f716e8c801a131954
MATLAB
1,221
25
function [out] = extractAdjMat(dataTable,measure,patientRows) %UNTITLED Summary of this function goes here % Detailed explanation goes here if contains(measure,'wPLI_dbt_spectrum') extractData = @(r) cellfun(@(s) s.wPLI_spectrum,r,'UniformOutput',false); metadata{iPatient}.wPLI_freqs = dataTa...
6091133936b26f98b5f94d95d02ec2e46038faa2fe3941ff6df767eb66e86bf8
MATLAB
1,222
41
function complete = makeToneThresholdExp(frequency, duration, levels, ... delays, trialFac, shamTrialFac) %MAKETONETHRESHOLDEXP creates an experiment with tone stimuli. % Arguments (defaults in square brackets): % frequency - the frequency of the tones % duration - tone duration % levels - an array of tone ...
8077fcc25823baac97322aae00e7b14e2b642f90cdafffb9a29b7663963ba863
MATLAB
1,224
43
function mdp_table = process_mdp_table(mdp_table, rat_states, experiment) % JN 2019-07-04 mdp_table.Properties.VariableNames{'area'} = 's_area'; rat_states.loc_x = rat_states.loc(:, 1); rat_states.loc_y = rat_states.loc(:, 2); rat_states = removevars(rat_states, {'loc'}); switch experiment case 'Ana' ra...
895e5ee3495406b46a17cc92673c5d43fb730a70c029f5fdb152668eda0e0499
MATLAB
1,224
51
function [nR_S1 nR_S2] = trials2counts(stimID,response,rating,nRatings,cellpad) nR_S1 = []; nR_S2 = []; % S1 responses for r = nRatings : -1 : 1 nR_S1(end+1) = sum(stimID==0 & response==0 & rating==r); nR_S2(end+1) = sum(stimID==1 & response==0 & rating==r); end % S2 responses for r = 1 : nRating...
ca8475ee0022cec773058bc21888e6495782c15478ed45235c2e62e255165135
MATLAB
1,224
30
function in1Process = SS_PointProcess1(inNSamp, dbFreq, chType) %Synopsis: % IN1PROCESS = SS_PointProcess1(INNSAMP, DBFREQ, CHTYPE) %Generates a time series having INNSAMP samples representing a point %process having a mean frequency of DBFREQ and whos properties are set by %the string CHTYPE. The latter can be set t...
1217b1cfe6ec10dad35ee15609c29815f809b5524e62caa37fad3bae33dbbbff
MATLAB
1,225
34
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <view_ts: a function to view timeseries 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 Fo...
312eace3eb4289a4952fb0f9f6812ed984167854db15ab18b171fbf30d5226ec
MATLAB
1,233
45
function [coef_ort,lowUN_lowTA] = tdrVectorOrthogonalize(coef_fix,ortpars) % tdrVectorOrthogonalize orthogonalize regression vectors % % Inputs: % coef_fix: regression vectors % .name: vector names {nvc 1} % .response: vector coefficients [ndm 1 nvc] % .dimension: dimension labels {ndm 1} % ortpars.name: ...
6512d0f1ef05843228d09973f5bf3c472d392bebd4a53133599a145b743e644e
MATLAB
1,236
72
function Tif_Parse(DIR,varargin) % Tif_Parse % Parse Data from Tif stacks into MATLAB % Created: 2016/02/12 % By: WALIII % Updated: 2016/02/15 % By: WALIII % Tif_parse will do several things: % % 1. Put Tif files into .mat files, such that theey will work with the FreedomScope % pi...
25e2dcdafe5573daf4861c1e19723fc2b9e65c923c4184987538b3359c1302d9
MATLAB
1,240
56
function area = getFuncArea(x,y, areaTable, centData) x0 = centData(1); y0 = centData(2); R = centData(3); %find distance from center: r = sqrt((x-x0)^2+(y0-y)^2); %if outside the circle if r > R area.num = -1; area.type = categorical({'-1'}); return; %if inside inner circle elseif r <= areaTable.r1(1) ...
190a8689be723874f8841068f346ea21cc63461486af06c63e4cd4153bdf6092
MATLAB
1,241
50
% This script performs the primary analysis in Nair et al., 2020 and % reproduces Fig 3 E,F & Fig S2 % This makes use of the parallel computing toolbox in matlab, please change % the parfor loop to a for loop if this toolbox is unavailable: CC_All_parfor = zeros(36,36) CS_All_parfor = zeros(36,36) %% Lo...
48321c7e3776b2d3ebb42d9136a5eeb3a3e7f2e223ac1c10325307852ad8c84c
MATLAB
1,241
49
function ChangeElastixParameterFileEntry(filename,oldTextLine,newTextLine, newfilename ) % Define file path and text to search for %filename = % Replace with your actual file name %oldTextLine = % The text you want to replace %ewTextLine = ' % The text you want to replace it with %newfilename = new name for mod...
5fc59e1ae65e3f72dea266cea67e0fd9e6cf4aea8d9c15df44aa337a75916fac
MATLAB
1,241
29
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <resampletoTR: resamples breathing data to TR > % % 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 Foundat...
415534bd2301674a3f90a3d602d7228a1da709391bc938f2f67caa15ff1a0c2d
MATLAB
1,245
39
function [congruentTrls, incongruentTrls]... = findTrialsForCoherence(STIM,PS) % Pull trials from STIM for use in mscohere or wcoherence trls = I &... SORTED.tilts(:,1) == conditionarray(cond,2) & ... STIM.tiltmatch == conditionarray(cond,3) & ... STIM.adapter == condi...
60ffe1a30df3b3943b5f5226edb7c85cb4d2102d2373ae3bedd3a130037493b4
MATLAB
1,245
34
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <ROImean: calculates the mean value in a region of interest > % % 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 F...
9119efdd40b082013ac068e4625b0dcd98238277572c2ff65515e37c4d6703a0
MATLAB
1,246
50
% This script performs the primary analysis in Nair et al., 2020 and % reproduces Fig 3 E,F & Fig S2 % This makes use of the parallel computing toolbox in matlab, please change % the parfor loop to a for loop if this toolbox is unavailable: CC_All_parfor = zeros(36,36) CS_All_parfor = zeros(36,36) %% Lo...
86f90138a984732302b0c1767e06775f73617f8a05f19aa8df7cdbeac12d395a
MATLAB
1,248
50
% This script performs the primary analysis in Nair et al., 2020 and % reproduces Fig 3 E,F & Fig S2 % This makes use of the parallel computing toolbox in matlab, please change % the parfor loop to a for loop if this toolbox is unavailable: CC_All_parfor = zeros(36,36) CS_All_parfor = zeros(36,36) %% Lo...
b35ed3c1254fd4c7f35e98957190e92c4f7efd5dacf6f38cf2693f14bc382910
MATLAB
1,248
36
function append_results_folder(pipeline_data) point_names = pipeline_data.points.getNames(); % create point folders for composite tifs for index=1:numel(point_names) [~, point_folder] = fileparts(point_names{index}); new_folder = [pipeline_data.run_path, filesep, 'composites', file...
c883c00170d8c010669ff3f8b512643cb94593f28e4256c039b7c62788d9495c
MATLAB
1,250
34
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <ROIstd: calculates the standard deviation in a region of interest > % % 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 ...
c2cc1b4d1556fbcdef6381fb674da562d14bfb09470c352d65a663729709e22e
MATLAB
1,252
38
function ramp= Ramp_comp(varargin) % Ramp_comp class constructor. % c=Ramp_comp(STATIC_VALUE) creates a Ramp_comp object which is a % Signal component representing it's Ramp. global RAMP_COMP_DEFAULT; RAMP_COMP_DEFAULT=10; if nargin==0 ramp.name='Ramp_comp'; s_comp=Sig_comp(RAMP_COMP_DEFAULT); s_co...
d7c6955ef28b4fc65fc57ba44754a3da4cf2e929784d9df9b60a706152e035d3
MATLAB
1,254
37
function dXdt = evolDriveFiringAdap(t,X,p) % System of 30 differential equations to integrate % 10 types of neurons with drive equations (synaptic integration), % firing rate equations and adaptation equations; % interpolation of noise D = X(1:10); F = X(11:20); H = X(21:30); auxVec = [-F(5)-F(6),-F(5)-F(6),-F...
6dceda5364a728c5bbc0ab0688cf8f028cc2cae100bf9db2d8eff16c2313d983
MATLAB
1,257
49
%% % Simulation results for the non-spatial one population model for networks % with and without astrocyte ensheathment % % Creates S2 Fig %% % Load the data load('./CompressedData/NonspatialOnePop/S2Fig_both_ex.mat') load('./CompressedData/NonspatialOnePop/S2Fig_J_ex.mat') load('./CompressedData/NonspatialOnePop/S2Fi...
a46b0403a0e3ba5343f0fc7d27612f7678f67108e98b6aba7e28f3656895398d
MATLAB
1,258
38
function comp = Phase_comp(varargin) % Phase_comp class constructor. % c=Phase_comp(STATIC_VALUE) creates a Phase_comp object which is a % Signal component representing it's Phase. global PHASE_COMP_DEFAULT; PHASE_COMP_DEFAULT=0; if nargin==0 comp.name='Phase_comp'; s_comp=Sig_comp(PHASE_COMP_DEFAULT);...
66fff9f39cb6d995544f3787aacf4d148a912739224df5198f23d0698f511926
MATLAB
1,260
28
function frame = imRemoveSpots(frame) h1 = figure; h2 = imshow(frame, 'Border', 'tight'); set(h1, 'units','normalized','outerposition',[0.05 0.05 0.9 0.9]); while true h_temp = text(20, 20, 'Drag an elipse around the rat', 'FontSize', 20, 'FontWeight', 'bold', 'color', 'red'); area = imf...
7e744219ad96878affa301e3700364be31aa41114e652dd1fc42698533d7d4c7
MATLAB
1,261
40
function comp = Depth_comp(varargin) % Depth_comp class constructor. % c=Depth_comp(STATIC_VALUE) creates a Depth_comp object which is a % Signal component representing it's Depth. global DEPTH_COMP_DEFAULT; DEPTH_COMP_DEFAULT=1; if nargin==0 comp.name='Depth_comp'; s_comp=Sig_comp(DEPTH_COMP_DEFAULT);...
c1fcf3a6730a7453c92a94211a8a0d469308a0c460edff9d18667881c4c4926d
MATLAB
1,261
38
%% Normalize SDF % out --> z-score, % inputs --> baseline population mean, baselin population stdev, % SDF from binoc PS congruent simultaneous. %get inputs % Pull out baseline period % nota bene -- Exclude basline of suppressor trials later!! - cannot % do it on the squeeze li...
61e35d92266c19d999bbfb38131c3e9e971a2fd7a63146a155f43a449cc9d0c8
MATLAB
1,262
38
function trials = createToneStimuli(frequency, duration, levels, delays, repFactor) %CREATETONESTIMULI creates an array of tone stimuli. % All tone stimuli have the same frequency and duration. Tone levels and % start delays vary by completely crossing these factors. % % Arguments: % frequency - the frequency o...
d9ed1aef67b2f743de36c0acd05004df2612005dcd53327528af2b080dd599df
MATLAB
1,265
46
function [MonocularEye2, MonocularEye3] = findMonocularTrials(STIM) % Pull trials from STIM % Exports logical vectors %ipsi: eye = 2 MonocularEye2 = ~STIM.blank & ... STIM.eye == 2 &... STIM.adapter == 0 & ... STIM.suppressor == 0 & ... STIM.soa == 0 & ... STIM.monocular == 1; ...
db3b2e53ac5c785bb4ae90c5ad9fe1b6c7ede7d2ba6e76cf5e027e42a8208d63
MATLAB
1,265
30
%% LaBGAS_3_spm_diagnose_firstlvl_models % % This script runs diagnosis on first level analysis generated by % LaBGAS_2_spm_fit_firstlvl_models.m % % IT IS MADE TO BE CALLED FROM THE PREVIOUS SCRIPT RATHER THAN FOR % STANDALONE USE %__________________________________________________________________________ % % authors...
3411b9c0c67029a0192bb510f43c6cc4b059937abbfd9437631f203c1dcc6bfa
MATLAB
1,267
40
function check_metadata(expdata, metadata) % JN 2019-07-09 % JN 2020-04-07 % JN 2020-04-30 title_str = sprintf('%s %04d-%02d-%02d %s', expdata.experimenter, ... expdata.year, expdata.month, expdata.day, ... expdata.folders.out_folder_session); fig = figure('Position', [0 0 1400 1000], 'Visible', 'on'); annot...
52e3be9c4179f773abe896eb59fd4cc70283b04e12d5c91ad69a3ec47b42af6e
MATLAB
1,267
47
function er=load_circuit(rx8) Interface='GB'; actx_cntrl=get(rx8,'Controler'); dev_num=get(rx8,'Device_num'); % RP=actxcontrol('RPco.x',[5 5 26 26]); if invoke(actx_cntrl,'ConnectRX8',Interface,dev_num); %connects RP2 through GIGABIT interface % if RP.ConnectRX8('GB',1) disp 'connected' else ...
f7c069003d9e4953a5d869ccc64c326dcb7dde4bf9d68d9f5ee30d1dcb1a3ed3
MATLAB
1,270
49
function MI = MI_Gauss(Cov_X,Cov_XY,Cov_Y,Z) %----------------------------------------------------------------------- % FUNCTION: MI_Gauss.m % PURPOSE: calculate Multi (Mutual) Information given covariance of data % % (Ay, 2001; Ay, 2015, Entropy; Barrett & Seth, 2011, PLoS Comp Biol) % % INPUTS: % Cov...
4390cba3111da1ecf1f943b625143dc7cf397b340d44b4a6a757331f632f4435
MATLAB
1,273
38
function meta=MetaBlock(varargin) % MetaBlock class constructor. % meta=MetaBlock constructs a metablock object with default values % meta=MetaBlock( run_mode) % run_mode - the run mode of the metablock (PART_RND/SEQ) % (PART_RND -the next is chosen randomly and the trials are running sequencialy; % SEQ- lines+tria...
a250cf4d6222d858317a94063060e98fbacc72026fc74039e2144fdb76cf8e00
MATLAB
1,274
38
function arrayUpsampled = SLupsample(array, dims, nZeros) %SLUPSAMPLE Summary of this function goes here % Detailed explanation goes here sz = size(array); szUpsampled = sz; szUpsampled(dims) = (szUpsampled(dims)-1).*(nZeros+1) + 1; if isa(array,'gpuArray') if verLessThan('distcomp','6.1') ...
b2da31bb023d4442c7e46ddd8ba7f3d614e7619825667b53f70825bda7d0525f
MATLAB
1,277
36
function meta_info_list=get_shrinked_meta_info(meta) % GET_SHRINKED_META_INFO returns abbreviated information on the MetaBlock. % META_INFO_LIST=GET_SHRINKED_META_INFO(META) returns abbreviated % information on the MetaBlock. % Each row represents a different line of the MetaBlock where each row hold the list of % sig...
81c1172b5c4faf61641acac72e29c80e1af289eb3327087a3886af9614d629c6
MATLAB
1,279
81
function fb_clickable_map(ROI,CA_DATA,varargin) % make current image a clickable map to address calcium traces % % % % % nparams=length(varargin); if mod(nparams,2)>0 error('Parameters must be specified as parameter/value pairs'); end for i=1:2:nparams switch lower(varargin{i}) end end if ~isfield(ROI.stats,...
0fb730863d88125901b45f1d85e0f59e6226bdb131103d79898afd183129ee94
MATLAB
1,280
47
function stat_data = cluster_stats(clustering_data, param) % JN 2020-12-13, 2020-12-17 dset = clustering_data.dset; irow = 1; stat_data = zeros(length(param.rats) * length(param.days) * 2, 9); for irat = 1:length(param.rats) rat = param.rats(irat); for iday = 1:length(param.days) day = param.d...
a25b6886f4126c152d809c373e4f2cc85b05d1005d45cc8f745c2b5a37f68c9a
MATLAB
1,282
35
function table_events = DT_eventlog_to_table(fname) % JN 2018-12-17 % Reads the eventlog and saves it to a matlab table for later use % this is faster than running 'read_mixed_csv' and the other previous % scripts % you can then do for example: % idx_filestart = table_events.EventType == 'File started'; % if speed e...
2253dd79aaa29c5ffdb00ad22d637c6a95b0f6f5ade097bf119c027306df5d87
MATLAB
1,286
58
%% calculate the mean angle of the right most cluster cmap = parula(11+1); cmap = cmap .* repmat([.9 .8 .9],size(cmap,1),1); thresh = 10; x = obs2obs(:); y = exe2obs(:); ind_min_rel = x>=thresh; x = x(ind_min_rel); y = y(ind_min_rel); % convert to angle angle = atand(y./x); n = sum(~isnan(angle)); nbins = round...
2ffde02ad7ca20939ca2651b64bd14999e49c34f3aaf5b03139285dc51882a35
MATLAB
1,288
40
function A = HALS_spatial(Y, A, C, active_pixel, maxIter) %% run HALS by fixating all spatial components % input: % Y: d*T, fluorescence data % A: d*K, spatial components % C: K*T, temporal components % output: % A: d*K, updated spatial components % Author: Pengcheng Zhou, Carnegie Mellon University, ...
fd0f3754f2ace17a9bb52b4dd21679751c19a9bfd195807ca85b32cab8f2583f
MATLAB
1,288
34
function samp_points=synth(sig,samp_rate,trial_dur,varargin) % SYNTH is NEW_SIGNAL 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 Frequency value and the requested Ph...
f9bbc286590d7e1058b8baef29519083fc504ff585eb206946edfcbd7a05d28f
MATLAB
1,289
44
function [T, paramFile,paramBBN,paramF,paramGap] = createTCPhaseRow(Told,paramFileold,paramBBN,paramF,paramGap,filename,trial_dur,location) type = categorical({'file'}); speaker = 3; samp_rate = 192000; stime = 50; etime = 150; ramp = 10; played = categorical({'no'},{'yes','no'}); att = 10; paramsize = size(paramFile...
d1e41ac2e108110fd2f79e85dbbb46d063e705bbef75a90b2e807a9a18c771bf
MATLAB
1,290
44
function [T, paramFile,paramBBN,paramF,paramGap] = insertFileRow(Told,paramFileold,paramBBN,paramF,paramGap,filename,trial_dur,location) type = categorical({'file'}); speaker = 3; samp_rate = 192000; stime = 0; etime = trial_dur; ramp = 0; played = categorical({'no'},{'yes','no'}); att = 40; paramsize = size(paramFil...
13a42cb3fcba2efb069c01394fff9fc99a9d0c20a48f99affc05881e730da74b
MATLAB
1,295
54
% This script performs the primary analysis in Nair et al., 2020 and % reproduces Fig 3 E,F & Fig S2 % This makes use of the parallel computing toolbox in matlab, please change % the parfor loop to a for loop if this toolbox is unavailable: CC_All_parfor = zeros(36,36) CS_All_parfor = zeros(36,36) %% Lo...
bcca06966630855f9101e604d83c000d07495472cefb8f60d9247085910c1587
MATLAB
1,295
23
%----------------------------------------------------------------------- % Job saved on 19-Feb-2020 14:49:07 by cfg_util (rev $Rev: 7345 $) % spm SPM - SPM12 (7487) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- function matlabbatch=spm_func2anat_registrati...
0d1604e85dbacd91aa0ad682d9c875789432d8159b438faf737eba13305fe12d
MATLAB
1,297
74
function [T]= entropy_fuzzy_threshold(C) %%%%Histogram probability computation Image=round(C); for i=1:size(Image,1) for j=1:size(Image,2) if Image(i,j)==0; Image(i,j)=1; end; end; end; Ns=max(max(Image)); % Ns1=min(min(Image)); hist1=zeros(1,Ns); for h=1:Ns for i...
322e8f738952098f74eb5363330406943b5a8af3a97a3ebacf3032f2e79448ef
MATLAB
1,300
39
function [Result] = AO_SendDout(DigtalChannelNumber,mask,value) %% This function sends a Dout to a specific Port channel ID %% DigtalChannelNumber is: the ID of the digital port %% mask is an 8 bit hex number input as a string. This variable masks the value, any 1 bit number changes the corresponding bit to the numbe...
9e3a15e7d7023103918b655d543c4f53535b603a2a3655d7d7fcc1c0a5a55ebb
MATLAB
1,300
39
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <grabTimeseres: extract voxel timeseries data and associated coordinates > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as publishe...
c27ac230953aa8f0ea7f68e3c49c9ceb7453a92db0ffc78c92a3e5c08d4c07e6
MATLAB
1,304
44
function [out_mov, n] = FS_Format(in_mov,startT) % Function used to eliminate redundancy in formats across data % WAL3 % d07.08.2016 n = size(size(in_mov),2); counter = 1; switch n case 2 % OLD FreedomScope format. try for ii = startT:size(in_mov,2) out_mov(:,:,counter) = squeeze...
8e8deb697624ebf1fb090f4d038b33991f60f9935d7e85f03da7dfdd1b65f6cc
MATLAB
1,305
46
function [T, paramFile,paramBBN,paramF,paramGap] = createBBNRow(Told,paramFile,paramBBNold,paramF,paramGap,trial_dur,location) type = categorical({'BBN'}); speaker = 3; samp_rate = 192000; stime = 100; etime = 300; ramp = 10; played = categorical({'no'},{'yes','no'}); att = 120; paramsize = size(paramBBNold,1); param...
3380e806cf6d5ae2aa7812047c2712726b74935bb8f92e781ea4e186bcd14dc4
MATLAB
1,306
40
function [tags] = getTagStruct(tiffObj) tags = struct(); allTagNames = {'SubFileType',... 'ImageWidth',... 'ImageLength',... 'BitsPerSample',... 'Compression',... 'Photometric',... 'ImageDescription...
8835220b40f1a7a113c7f57369435f07f9f442c7b22a4e6223e2c685ac9e6270
MATLAB
1,306
40
function comp = Level_comp(varargin) % Level_comp_comp class constructor. % c= Level_comp_comp(STATIC_VALUE) creates a Level_comp object which is a % Signal component representing it's level. global LEVEL_COMP_DEFAULT; global MAX_LEVEL; LEVEL_COMP_DEFAULT=50; MAX_LEVEL=120; if nargin==0 comp.name='Level_...
4d5e677c1221707cedba63607667d58b4303d0312d047ff028afbac9c4a9b38b
MATLAB
1,309
44
function [out_mov, n] = FS_Format(in_mov,startT) % Function used to eliminate redundancy in formats across data % WAL3 % d07.08.2016 n = size(size(in_mov),2); counter = 1; switch n case 2 % OLD FreedomScope format. try for ii = startT:size(in_mov) out_mov(:,:,counter) = rgb2gray(...
4eb14a18245caa85143865f17c4f5f91e11237a52a74b0fc09d973eb7e8e599a
MATLAB
1,312
38
function etime = ETime_comp(varargin) % ETime_comp_comp class constructor. % c= ETime_comp_comp(STATIC_VALUE) creates a ETime_comp object which is a % Signal component representing it's stimulation end time. global ETIME_COMP_DEFAULT; ETIME_COMP_DEFAULT=400; if nargin==0 etime.name='ETime_comp'; s_co...
50ab7fcb79d850210f36d69ea74c043f7e1887e4bdf583c19d670a529ff102dd
MATLAB
1,312
36
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <meanTimeseres: generates a mean timeseries from data based on input mask> % % 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...
a7b8f641eceb112454f3a073c38ee6d6c5ce9654bf9b347645052406b542255e
MATLAB
1,313
38
function comp = Trial_dur_comp(varargin) % Trial_dur_comp class constructor. % c=Trial_dur_comp(STATIC_VALUE) creates a Trial_dur_comp object which is a % Signal component representing it's Trial duration. global TRIAL_DUR_COMP_DEFAULT; TRIAL_DUR_COMP_DEFAULT=500; if nargin==0 comp.name='Trial_dur_comp'; ...
eb85bc90814f4cec6dcdb74af85c5a537533dc2f0d2235c482aec5555d8d7f8f
MATLAB
1,315
27
function [noise_function] = NoiseAddition(model_at_t0,SNR) %NOISEADDITION This is a small function which generates the background %noise in the in silico data with a specific SNR at time = 0 ms. % Detailed explanation goes here % Input: % model_at_t0 - double % This variable is the value of the model/function a...
1e67ac89540e69d6f5c2d6f9b5bd1fb828db02ef64000a20556267f8f7f9f8d3
MATLAB
1,316
38
function stime = STime_comp(varargin) % STime_comp_comp class constructor. % c= STime_comp_comp(STATIC_VALUE) creates a STime_comp object which is a % Signal component representing it's stimulation start time. global STIME_COMP_DEFAULT; STIME_COMP_DEFAULT=200; if nargin==0 stime.name='STime_comp'; s_...
6632ce5d57cb87163aeb26365d9743565687275f9ba4380019e4e7428b8b1df3
MATLAB
1,322
35
% GET_FORMULA_VALUE returns the final value of the formula. This function replace each % varaible in the formula with the corresponding numeric value, then it % calculates the final numeric value of the formula. % FINAL_VALUE=GET_FORMULA_VALUE(FORMULA,DEF_ARR,VAR_ARR) % returns the final value of the givaen formula. %...
bd452eaab931257a8564f7396f7808a18cddda970d1aa7d30280b5e3cdfd6938
MATLAB
1,322
35
%HICONTRAST Black-blue-red-magenta-green-cyan-yellow-white colormap % % Examples: % map = hicontrast; % map = hicontrast(len); % B = hicontrast(A); % B = hicontrast(A, lims); % % A colormap designed to maximize the range of colors used in order to % improve contrast between intensity levels, while con...
119dae8f8aa94bf4b010c76428d3b5376e14c686249698374ad3c1a26e778226
MATLAB
1,324
36
function plot_3_bars(data_original, basic_weights, additional_weight, ylabel_string) %Compute new means and SDs using the weights for i=1:3 data(:,i) = (data_original(:,i+1) - data_original(:,1)) .* basic_weights(:,i) / ... mean(basic_weights(:,i)) .* additional_weight / mean(additional_weight); [t p(i...
db44d830779cd3ceae8b73e5fbfb327a5f482a6c9f327dd00fce69dbc90a9db3
MATLAB
1,325
36
%PINK2 Black-pink-white colormap % % Examples: % map = pink2; % map = pink2(len); % B = pink2(A); % B = pink2(A, lims); % % A black to white colormap with several distinct shades, most of which % have a pink tint. This colormap converts linearly to grayscale when % printed in black & white. % % The...
d7d3b3df47fbe285859bb6202d24529da054b871d3fc38c58b3f156a05ca865b
MATLAB
1,327
40
function startup(varargin) %STARTUP Initialize runtime environment. % % SYNOPSIS % % json.startup(optionName, optionValue, ...) % % The function internally adds dynamic java class path. This process clears % any matlab internal states, such as global/persistent variables or mex % functions. To avoid unexpected state ...
8ed64ff68d3ab602b10a790a933c4ba81d79d3f4e3ac924ef929fef7b2351e16
MATLAB
1,329
42
% Calculate the intersection of two frames: previous and current. % Inputs: % previous - overlap in the previous data % current - overlap in the current frame % Output: % currentAdj - current frame, adjusted for the overlap % % Author: Dmitry Tebaykin % Contact: dmitry.tebaykin@stanford.edu function currentAdj = Mi...
b4fcfafc428f6bb3e84cdbe26281f3d1eb959f7cc74fb80721db7f54f86db360
MATLAB
1,336
41
load('AllFigureData.mat'); data=fig45; nClusters = 5; % 9; data.ROIs{strcmp(data.ROIs,'SFG')} = 'SFGpf'; ROIList = data.ROIs; nROIs = length(ROIList); early = zeros(nROIs,1); late = zeros(nROIs,1); alpha = zeros(nROIs,1); for iROI = 1:nROIs thisROI = ROIList{iROI}; early(iROI) = audResp.perc_hi...