sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
80bbfcf7474ef4de67ce18dfad808fdc5a063d23c96d7ddf1679894de9cd170e
MATLAB
6,229
155
%% Create intepolated MIC patterns and plot raw points (Figures 3A, S3) repo_path = 'Path_to\Manuscript_repository'; addpath('Path_to\wjn_toolbox_tsbinns'); addpath(genpath('Path_to\spm12')); addpath(genpath('Path_to\leaddbs')); folderpath_analysis = 'Path_to\Project\Analysis\Results\BIDS_01_Berlin_Neurophys\sub-mult...
1cd60ec878386750ac97e4c84a14ab9875f97256cbdaa2f53279da28c84c5ef0
MATLAB
6,230
155
%% Create interpolated MIC patterns and plot raw points (Figures 3A, S3) repo_path = 'Path_to\Manuscript_repository'; addpath('Path_to\wjn_toolbox_tsbinns'); addpath(genpath('Path_to\spm12')); addpath(genpath('Path_to\leaddbs')); folderpath_analysis = 'Path_to\Project\Analysis\Results\BIDS_01_Berlin_Neurophys\sub-mul...
044be4776b6ca81a0fc580f39407c0b868c806938a2414878dffe20278e6b406
MATLAB
6,233
176
function ret = aqua_extract( inputPath, options ) % AQUA_EXTRACT Extract AQuA events from a res file; called by AQUA_EXPORT % ret = AQUA_EXTRACT(inputPath) loads the res-file at `inputPath` and % puts all of the data for export into the structure `ret` % % TODO This doesn't handle the no-uncaging case wi...
a715bb9ee5ff29eca86485f284e66331d800c0b08efbe7714789d20ad8f9dca2
MATLAB
6,260
212
function [s,mxy,M] = isochromat_GRE(theta,phi,TR,T1,T2,Niso,varargin) % [F0,Fn,Zn,F] = isochromat_GRE(theta,phi,TR,T1,T2,Niso,varargin) % % Single pool ISOCHROMAT simulation for gradient echo sequences % % arguments: % theta: vector of flip angles (rad) - length = #pulses % ...
cae8fe826f024d15701354143a61a188dfc109e53b902266803f261bba06c478
MATLAB
6,268
159
function [scratchpad] = train_adaboost(trainpats,traintargs,in_args,cv_args) % [scratchpad] = % TRAIN_ADABOOST(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS); % % AdaBoost.MH/AdaBoost.MO classifier. Equivalent to BoosTexter for % continuous numeric data. % % NOTE: rest conditions (sum(traintargs,1) == 0) are exluded from trai...
49d7c80796bc0ba65a00921bf0e7613735c7f45cffb962e42422720eb0325b32
MATLAB
6,269
271
function Duszkiewicz2024_Figure_AnticipatoryFiring % This script reporoduces panels from: % Extended Data Figure 3 % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you can redistribu...
b8b5af50cce37e6a0cc488129f5010097a1ec7173e957254d35388c6f4029715
MATLAB
6,269
194
function [errs warns] = unit_afni(errs, warns) % [ERRS WARNS] = UNIT_AFNI() % % This is a unit test for the SPM ANALYZE import/export % functions, LOAD_ANALYZE_MASK.M, LOAD_ANALYZE_PATTERN and % WRITE_TO_ANALYZE.M. % % It requires several data files to function properly, which % it loads and writes out in var...
9c013dd83895f817933a153a4e31cbc74d0d52df8b83df981826ede6c8eddec7
MATLAB
6,276
283
function Duszkiewicz2024_Figure_SingleRec_CueRotation % This script reporoduces panels from: % Extended Data Figure 2 % Run in folder A3707-200318 to reproduce manuscript figure % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien...
38b237b3ebaab4cf3343f6a8be21c232996515146af01b8d68ee56c8dcf1f72b
MATLAB
6,281
190
function [scratch] = train_svm(trainpats,traintargs,in_args,cv_args) % USAGE : % [SCRATCH] = TRAIN_SVM(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS) % % N.B. Please read Ryan Moore's instructions in % mvpa/core/learn/MVPA_SVM_setup.rtf for info on setting up % SVMs in the toolbox. % % This is a support vector machine training...
e68958eb63e86f823f98a04c4a354eb230eab66fb0221de564df67b7c32f8ab9
MATLAB
6,282
179
function [figOut] = plot_PAC_neuron(spike_times,datMat,srate,low_fb,HF_steps,tcutEdge) %% plot_PAC_neuron(spike_times,datMat,srate,low_fb,HF_steps,tcutEdge) % Plots the data table used to compute the GLMs for PAC neuron selection % % Input: % spike_times: matrix containing the spike times from a given neuron (samples...
fcacb1d3a1bec06cd5185efb01f939adcced2c07c5c1c51e6ccdb946d46b0286
MATLAB
6,284
205
function registration_example2d(varargin) % REGISTRATION_EXAMPLE2D 2D example for image registration % % registration_example2d() % % See also REGISTRATION_EXECUTE % Copyright (c) 2012 Daniel Forsberg % danne.forsberg@outlook.com % % This program is free software: you can redistribute it and/or modify % it under the t...
c38fa84395dcea400bfd55191f180bcc9f568710fff95870244fa21588e8f931
MATLAB
6,289
157
% [tInc,tIncCh] = hmrR_MotionArtifactByChannel(data, probe, mlActMan, mlActAuto, tIncMan, tMotion, tMask, STDEVthresh, AMPthresh) % % UI NAME: % Motion_Artifacts_By_Channel % % % Identifies motion artifacts in an input data matrix d. If any active % data channel exhibits a signal change greater than std_thresh or %...
140789e37afc155ef3b31253af5103b83d4d1021ff2d629b5961dd04f08a5d76
MATLAB
6,290
211
%DEMMDN1 Demonstrate fitting a multi-valued function using a Mixture Density Network. % % Description % The problem consists of one input variable X and one target variable % T with data generated by sampling T at equal intervals and then % generating target data by computing T + 0.3*SIN(2*PI*T) and adding % Gaussian n...
3c72213b369baca1835679d76b48aab663720c991f94964253884ff44049a0d6
MATLAB
6,291
155
function res = bpass(image_array,lnoise,lobject,threshold) % % NAME: % bpass % PURPOSE: % Implements a real-space bandpass filter that suppresses % pixel noise and long-wavelength image variations while % retaining information of a characteristic size. % % CAT...
e12f8cf77a522e07155304863e61c61080549ebb1931ed2a6fa9608b2101864c
MATLAB
6,293
183
% Data location data_location = TFR_Clustered_Data; save_data_location = TFR_Clustered_Data; % Condition name Condition_Name = cond_labels; % Channel list Channels = cluster_labels; %% PT vs. Color % figure; clf idx_subplot = [3,11,15,7,9]; for chan=1:length(Channels) % Average PT vs....
c9de0808ead7bc34a68bf32779914cb29cf0efeeee5e8fa5551e001f879496c0
MATLAB
6,297
210
%% %% Exp1 vs Exp2 non-linear vs. linear mixing 1) construct the choice matrix clear all; clc; mdir=pwd; cd('../Data') load MainChoiceData.mat load TrainingBlock_IX.mat load ExcludedSubjects.mat cd(mdir); Exps=[1 2]; OriColorMat=(1:36); JNDs=[.6 .7 .8]; OriClrResmat=[0 0;1 0;0 1;1 1]; OriColorMa...
fab56ca79aa945f4bb10ed307cf5bef915db57ed6ac6e045a98c57149b9797c8
MATLAB
6,298
159
function [H, pValue, CM_limiting_stat] = cmtest2(x1 , x2 , alpha) %CMTEST2 Two-sample Cramer-von Mises goodness-of-fit hypothesis test. % H = CMTEST2(X1,X2,ALPHA,TAIL) performs a Cramer-von Mises (K-S) test % to determine if independent random samples, X1 and X2, are drawn from % the same underlying continuous po...
8b031f70cd58341f437e83c2d8b8dc99cce267917abc0b2b7295980e28fc4ce2
MATLAB
6,307
154
%************************************************************************** % % This is a simple extension of the bar plot to include error bars. It % is called in exactly the same way as bar but with an extra input % parameter "errors" passed first. % % Parameters: % errors - the errors to be plotted (extra...
a1dfad7779ad75fb44ecbe2fabea4f93d86926e880c8630c4165c3288e1aaba6
MATLAB
6,314
154
% Tutorial script for predicting the EBC data - "Advanced" Version % % This tutorial will guide you in a step-by-step fashion through all % of the analysis necessary to recreate one of the Princeton EBC % Team's submissions to the competition. Unlike the first tutorial, % we will analyze all thirteen primary regressor...
47f00ce64db3d47ea0ee1790886f9434cd223b267562632a78e2e5130e275542
MATLAB
6,319
224
function [efield,slice,smear,Q,T] = FieldSynthesisTheorem(efield) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Small program to illustrate a new Field Synthesis Theorem. % % In essence it says that the projection of the absolute modulus of a % complex field is the same as when one...
ca90d5d7bddb546022ce8f9e130c9f73e59d249cd5c81e59375c567205de4f05
MATLAB
6,320
187
% STATUS: analysis. For internal report. % % SYNTAX: % [snr,snr_Mean,snr_Std,cardiacSize,cardiac_Mean,cardiac_Std] = ... % calc_AvgSNR_Welch(sbjNum) % % DESCRIPTION: % calculate different estimates of SNR and some other stats related to % noise analysis. % % RESTRICTION: % Only for sbj 12 and afterward. % % INP...
72336c121e07e539dc4ac52f96fe467f54a8af6118858e2a05083f611ad61689
MATLAB
6,321
192
% Classifier unit test % % Classifier: libsvm % Note: the classifier itself is not being tested since it's external but % rather the MVPA-Light interface. rng(42) %% do not change - might affect the results tol = 10e-10; mf = mfilename; %% first check whether LIBSVM is available check = which('svmtrain','-all');...
62b482c1c76fec174789ddbc3c905d72320bb768b52ed418537ead462aede18d
MATLAB
6,322
207
function [subj] = zscore_runs(subj,patname,selname,varargin) % Zscore each voxel, separately for each run % % [SUBJ] = ZSCORE_RUNS(SUBJ,PATNAME,SELNAME,...) % % For each voxel in each run, subtract the mean activity and scale % so that the variance is 1. % % Adds the following objects: % - pattern object % % This func...
ed7f4d825463aa58b142df95316d72732d0d8e85378f466a1d95d4045faae5c6
MATLAB
6,322
109
function Dataset = generate_dataset(animal_folder_listing,analysis_folder,geno_names,rec_type,events_names) Dataset.info.geno_names = geno_names; Dataset.info.rec_types = rec_type; Dataset.info.mice_list = cell(length(rec_type),length(geno_names)); Dataset.whole_dff.data = cell(length(rec_type),length(geno_names)); Da...
1a06b58206288ac3f859fdf601a3508d7841092d9b52165573d7669c150fbbc8
MATLAB
6,329
179
function [subj] = feature_select(subj,data_patin,regsname,selsgroup,varargin) % No-peeking feature selection % % [SUBJ] = FEATURE_SELECT(SUBJ,DATA_PATIN,REGSNAME,SELSGROUP,...) % % Calls a statmap generation function multiple times, using % a different selector each time. This creates a group of % statmaps, which are ...
735ea7f358c27dde3ee5cab585e344b3f1486863aa5a2b895b0f8ff6e87da5b6
MATLAB
6,343
153
function [taskStruct, dispStruct] = initTask() % some initial global setup RandStream.setGlobalStream(RandStream('mt19937ar','Seed','shuffle')); KbName('UnifyKeyNames'); RestrictKeysForKbCheck( [] ); % Screen('Preference', 'SkipSyncTests', 1); % general task info taskStruct = struct(); ...
83406ce046083e84a71220a7a12ef6b29f4dccc6a0f9ff830eae1e373b4e2f2a
MATLAB
6,343
159
function [fs_index,n_vox_steps,output] = feature_selection_filter(cfg,fs_data,labels,data_scaled,n_vox,i_step,i_train) output = []; % init % create field if non-existent if ~isfield(fs_data,'external'), fs_data.external = []; end % Rank features for feature selection [ranks,ind] = rank_features(cfg,fs_data.e...
b641bc1cc5fc26362a2dfea50dadc2e82af88abc8867bab3fb48f0bea24d6598
MATLAB
6,349
194
function guess=find_bpn2_7(sv_var,coords,C,guessed,combinations,final_time) top_num = 20; num_neu = 3; selection = zeros(1,numel(guessed).*top_num + 1); for i = guessed [~, corrRanking] = sort(C(i,:),'descend'); selection = [selection, corrRanking(1:top_num)]; end selection = unique(selection); sel...
650f55bfaabe904dfdba72c70b61996a5d84c4e2301db2914168d61adc5115e2
MATLAB
6,353
184
%LoadBinary - Load data from a binary file. % % USAGE % % data = LoadBinary(filename,<options>) % % filename file to read % <options> optional list of property-value pairs (see table below) % % ========================================================================= % Properties Values %...
b604485d2c8102d43c3349104ad4dd63a005b84d3c3fecb1b73a52b9cc10139f
MATLAB
6,354
233
function [F0,Fn,Zn,F] = EPG_TSE(theta,ESP,T1,T2,varargin) % Single pool EPG (classic version) for TSE sequences % [F0,Fn,Zn,F] = EPG_TSE(theta,ESP,T1,T2,varargin) % % arguments: % theta: vector of flip angles (rad) including excitation % ESP: Echo spacing, ms % ...
047b508d92bd501207e5482db84cd24af3a6e309a346d4df621a4c4466bda4b5
MATLAB
6,360
178
clear; close all; clc; %% position = -40:4:40; radius = 40; % in um pixel2um = 2; nonlineartype = 1; % std [X, Y] = meshgrid(position, position); gridposi = [X(:), Y(:)]/pixel2um; ngridposi = size(gridposi, 1); Act = @(MaxAmp, Alpha, Tau_r, Tau_f, t) MaxAmp * Alpha * (exp(- t/Tau_f) - exp(- t/Tau_r)) /(Tau...
f64eb36041e56e1bd8cf01af94153db529812cf8561d31a690f6aadb6c70ff1e
MATLAB
6,360
229
function [errmsgs warnmsgs] = test_zscore_mvpa() % USAGE : [ERRMSGS WARNMSGS] = TEST_ZSCORE_MVPA() % Tests ZSCORE_MVPA against the Stats toolbox zscore % % OUTPUT ARGUMENT: ERRMSGS % The output argument, 'errmsgs' holds the error strings that the % function gives out if it fails any of the tests. % % WARNMSGS = cell ...
f3fdee8c9e075451550e8fc189f7bf0c69d47113219bd147c606d84761b6d757
MATLAB
6,366
161
% This script reslices an OCT volume for a specific iteration, assumes the % following was already run: % 1) 01 OCT Preprocess - pre-process volume (optional, this script can % reprocess) % 2) 11 Align OCT to Flourecence Imaging - alignment was calculated appendToDimensions.note = [... 'Y directio...
77c70ec67653dccf2bf08b8c9b9a2fcea6df8d3b242e9c4144ba5a3f925fb160
MATLAB
6,372
175
function [LFP_PAC_figs] = NWB_samplePAC_LFP(nwbAll, paths) %% NWB_SAMPLEPAC_LFP Calculates phase-amplitude coupling metrics for a sample electrode (Fig 2d, Daume et al) % in: % - nwbAll: a cell array of all nwb files imported in NWB_SBCAT_import_main % operation: % - paths: Paths defined in NWB_SBCAT_import_main. The ...
0f736b314bdd02716e2a5ed905840886f2925aade5de14be9561b43f47c39626
MATLAB
6,381
149
function [coh, C, Cc, Corig, Corig1, c, c0, hl] = reconstruct_coh_new(freq, freqnoise, leadfield, opts) if nargin<4 opts = []; end N = ft_getopt(opts, 'N', 100); % number of sensors in the subsample nrand = ft_getopt(opts, 'nrand', 0); refindx = ft_getopt(opts, 'refindx', []); lambda = ft_getopt(opts...
5c88ebe8d1e0e0dfa225a34015cffb51121718d0ed97a8fae44b4926d8eaa96a
MATLAB
6,384
236
clear all; close all; %spm('defaults','eeg'); spmfile = 'D:\home\Data\DBS-MEG\Phantom\090715\SPMstim\spmeeg_uespmeeg_phantom090715_BrainampDBS_20150709_02.mat'; %spmfile = 'D:\home\Data\DBS-MEG\LN_C54\100316\SPMrest\LN_C54_on.mat'; %spmfile = 'D:\home\Data\DBS-MEG\SW\190207\SPMrest\SW_off.mat'; D = spm_eeg_load(spmfil...
2d6b83066cae85f16a87a81ac89956d74798aa947bdf6c4eb2390e6d4b4f3eb0
MATLAB
6,392
194
% This script analyzes images latent space %% Inputs datasetBaseDirectory = s3SubjectPath('','_MLModels'); baseMLFolder = [datasetBaseDirectory '2020-08-15 10x Yonatan Pix2Pix']; % Path to the specific model results modelName = 'pix2pix'; % 'pix2pix_2to1_ratio','pix2pix_256px256px' testImagesPath = [baseMLFol...
c47d97a60baa57e72875ba908223b6f043863fcd530f3a87f0bde25a7294ddd7
MATLAB
6,393
168
function outputFolder=generatePatchesFromImages(alignedImagesFolder,outputFolder, patchSize_pix, aspectRatio) % This function takes image pairs and generates patches %% Inputs % Folder with aligned images (input folder) if ~exist('alignedImagesFolder','var') || isempty(alignedImagesFolder) alignedImagesFolde...
f2022ba4a4435db29e930c10ae0a3a41619a3f8fc8970907a7b9193075d2b4e4
MATLAB
6,394
200
function Experiment = run_vwm(Experiment) % Run Experiment % Input: Struct 'Experiment' with fields 'Subject', 'Display', 'Stimulus', 'Timing', 'Keys' % Output: Struct 'Experiment' with updated field 'Subject.Log' nRuns = Experiment.Design.nRuns; mainPath = Experiment.mainPath; Mode = Experiment.Mode; Subject = Exp...
d779838f78796207e24c7a74dd7835a5a53a1c7e182e20669973ee955d7bfe48
MATLAB
6,399
203
function [net, options] = rbftrain(net, options, x, t) %RBFTRAIN Two stage training of RBF network. % % Description % NET = RBFTRAIN(NET, OPTIONS, X, T) uses a two stage training % algorithm to set the weights in the RBF model structure NET. Each row % of X corresponds to one input vector and each row of T contains th...
3fbec620882e92c7540badc3746c96f5e036aa380472a0f8fa5b67e65cb85957
MATLAB
6,406
134
% function output = transres_accuracy_matrix(decoding_out, chancelevel, varargin) % % Get a matrix of the accuracies of all pairwise comparisons (i.e. chance = % 50 %) from a multiclass classification. Libsvm doesn't provide this % directly. The diagonal is not defined and set to NaN. % IMPORTANT: % This function is NO...
4bf5c4bec596545b643c754d063386171bd6ba9dc015bd272e33884fdaa50194
MATLAB
6,412
206
function [tform, isHistImageFlipped] = HistFM_xcorr(imFM, imPB, imHist) %This uses normalized cross correlation to align the input %the histology slices with input flourecence microscopy images % %It finds the correct rotation, translation, and horiztonal flip which %maximizes the normalized cross correlation. % ...
294b88f24d7791ed78c89c93495e00cdc8df7a263c2050b2ad41237d5b64ead3
MATLAB
6,414
210
%DEMGMM4 Demonstrate density modelling with a Gaussian mixture model. % % Description % The problem consists of modelling data generated by a mixture of % three Gaussians in 2 dimensions with a mixture model using full % covariance matrices. The priors are 0.3, 0.5 and 0.2; the centres % are (2, 3.5), (0, 0) and (0,2...
aa037913c88e5fa0464728a32b36ca904f1ca851e0b4e165271e7b8213bb6198
MATLAB
6,417
227
function [data, metadata, c] = yOCTFromTif (varargin) % This function tiff file. % USAGE: % [data, metadata, clim] = yOCTFromTif (filepath [, parameters]) % INPUTS: % filpath - filepath to load. Can be a .tif file or a tif stack folder. % For each file in the tif stack, image dimensions are z-x. % ...
e82e29d150b9095a87ab088545329c6513565ba5b3ce0fc060a488738d3d6c5d
MATLAB
6,420
197
function [returnVar,msg] = RemoveNoiseFromSpk(fbasename,shankIx) % USAGE: % RemoveDCfromDat(fbasename,shankIx,chanIx) % This function removes DC from dat files by computing the average of % the first 1e6 samples (or less if file is smaller) % INPUTS: % fbasename: file base name % shankIx: vectors o...
1e0217a09e8d20c1967757af32ac133ae9b15fd8ce742479dbebfd38966ce5c9
MATLAB
6,422
156
function Experiment = set_up_subject(Experiment) % Set Up Subject % Input: Struct 'Experiment' with fields 'mainPath' % Output: Struct 'Experiment' with field 'Subject' % 'Subject' contains fields: % 'id' - subject ID <- from input prompt % 'age' - age of subject <- from input prompt % 'group' - ex...
e97ae63bdbee2bcaac487b2b7345a95f5d84671db2ea4c1fbcbc8e60e916df0d
MATLAB
6,422
182
function hpol = polar(varargin) %POLAR Polar coordinate plot. % POLAR(THETA, RHO) makes a plot using polar coordinates of % the angle THETA, in radians, versus the radius RHO. % POLAR(THETA, RHO, S) uses the linestyle specified in string S. % See PLOT for a description of legal linestyles. ...
f336408a3459474664d1b993e049fe6eb064cf853d2b49855129831e71bdb83d
MATLAB
6,459
116
% Copyright (c) 2014, Trustees of Boston University All rights reserved. % Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and t...
806926f62ae45b0b5a84cea4af961c1c97699e765a0f44f4fa739e1d002d28c8
MATLAB
6,464
174
%% Main Flow Tracking Analysis Script % The goal of this analysis is to track actin dynamics in actin % fluorescence movies using Optical Flow and Crocker-Grier Least-Squares % Minimization Particle Tracking. function MainAnalysisScript(fileParameters, mainAnalysisParams) %% Start MainAnalysisScript fprintf('\n- - -...
78eff0edcb9d4f8726705240899b4372ed8c2a00ec5278f1d1b4b99160ac07fc
MATLAB
6,473
166
function X = simulate_erp_peak(n_sample, n_time_point, pos, width, amplitude, weight, shape, scale) % Simulates ERP data. % % Usage: X = simulate_erp_peak(n_sample, n_time_point, pos, width, amplitude, weight, shape, scale) % % Parameters: % n_sample [int] total number of samples (e.g. trials) % n_time point ...
ca907d11fcdc0cd86fe10d6a74a96559114a8917dd37f54d0c820636a8d6df92
MATLAB
6,480
199
function [updateField, updateCertainty] = ... morphon2d(moving, movingCertainty, fixed, fixedCertainty, ... scale, varargin) % MORPHON2D Estimates a displacement field between moving and fixed using the Morphon % % [updateField, updateCertainty] = morphon2d(... % moving, movingCertainty, fixed, fixedCertain...
a2dfd4363ba7b6b4ff4edf9849a44a8fb35e795c7d5806e379605c13c971fde8
MATLAB
6,484
166
% Data location data_location = TFR_Data; save_data_location = TFR_Clustered_Data; % Find indices of the channels count=1; for i=1:length(midfrontal) if isempty(find(strcmp({channel_location.labels}, midfrontal{i}))) warning(['Warning: no electrode: ' midfrontal{i}]); else mi...
ffd1f979c71404121017b33b6628775737f96cb89deda34a3a962852d2b15d3a
MATLAB
6,489
182
function alignHistFM(slidePaths,histRawPaths,isDelayedUpload,tmpFolderSubjectFilePath, isRunAutomatic) %This function alignes histology slices with flourecence microscopy images %INPUTS: % - slidePaths - cell array of s3 path of the slides % - histRawPaths - cell array of where the histology raw data is located, %...
0a1a9d8d31f386627ebe383a1dd0e6a6566e55dbe0adb8a2ad4988237a124b53
MATLAB
6,492
218
function [] = view_montage(subj,anat_type,anat_name,funct_type,funct_name,varargin) % View your data in a montage of slices % % [] = VIEW_MONTAGE(SUBJ,ANAT_TYPE,ANAT_NAME,FUNCT_TYPE,FUNCT_NAME,...) % % Uses Keith Schneider's MR_MONTAGE to do the main % displaying work. % % ANAT_NAME = the name of the pattern that you ...
1a9624c903b8be5057c4d92446c0bc0536e1f2688310e67a3ad0b09f0d64c018
MATLAB
6,492
116
% Hi there! % % This is the complete pipeline to recreate the analysis and plots in % "Working memory and imagery in early visual cortex" by Weber, % Christophel, Görgen, Soch and Haynes. To create the figures from the % paper, just complete a few file paths below (look for '...') and then hit % run (ignore the warnin...
19764b87d749d7fd378af9cece45dc0689fd3eda734af6908c4bedb3ef51bba0
MATLAB
6,495
185
function [OUT] = getBehavior_vp_eegCAT(IN,locking,trialnums,set_fb,pos,set_stim,pos_stim,rt_stim) %aggregate variables valueP1 = [IN.value1_p1 IN.value2_p1]; valueP2 = [IN.value1_p2 IN.value2_p2]; difficultyP1 = [IN.diff1_p1 IN.diff2_p1]; difficultyP2 = [IN.diff1_p2 IN.diff2_p2]; valueP1_old = [IN.value1_p1_old ...
7dd6ebe92aaf053a5a4bb84959b9ce2a2a7f6bbc59418946a1187939a24309b1
MATLAB
6,505
191
close all; clc % DATA = {NREMSoundallTrialsControl*100, NREMSoundallTrials*100}; DATA = {NREMSoundallTrials*100}; s2n = []; incLatency = []; Fs = round(1/(eventT(2)-eventT(1))); for i = 1:length(DATA) data = DATA{i}; w = size(data,1); for j = 2:2:w %initialize s2n(...
a171298634c48cc9131f3ad73b7dfd5803e884f44567b7176ffc2041b22d6a5c
MATLAB
6,509
192
function Experiment = set_up_stimuli(Experiment) % Set Up Stimuli % Input: Struct 'Experiment' with fields 'mainPath', 'Display', 'Subject' % Output: Struct 'Experiment' with field 'Present' % 'Present' contains one field per run 'R[run]' % 'R[run]' contain fields: % 'Rand' - randomization info (order ...
2ae344664f2de5d5d836cb826c4e61810a4604a71488e89150913ee1ea1f7aa6
MATLAB
6,510
261
function [errmsgs warnmsgs] = unit_adj_sphere2(varargin) % Unit tests for ADJ_SPHERE2.M % % [ERRMSGS WARNMSGS] = UNIT_ADJ_SPHERE2(...) % % See UNIT_TEMPLATE.M and UNIT_ADJ_CUBE.M for more info defaults.doplot = false; args = propval(varargin,defaults); errmsgs = {}; warnmsgs = {}; simple = ones(5,5,5); s_radius = ...
492ba64a7792ae0cb1d3fdf0253688c0cb9dce2226e5919d9cf4969cd5d8cbb1
MATLAB
6,512
147
function [qScore,... isOCTImageQualityGood, isHistologyImageQualityGood, alignmentQuality, ... areaOfQualityData_mm2 ... ] = computeOverallSectionQuality (input1) % This function computes an overall quality score for the section. Possible % USAGE (2 options): % [...] = computeOverallSectionQuality(s...
40aa2df39e0aaf36c3f197341025f9f20cb369622ae4f48f44f3e0faa58cbe6a
MATLAB
6,518
184
function hpol = polar(varargin) %POLAR Polar coordinate plot. % POLAR(THETA, RHO) makes a plot using polar coordinates of % the angle THETA, in radians, versus the radius RHO. % POLAR(THETA, RHO, S) uses the linestyle specified in string S. % See PLOT for a description of legal linestyles. ...
046c66296d5995bb9e133074e4b867130265b913d9303ef69e509784a7105b8f
MATLAB
6,519
218
classdef acti < timeseries %ACTI create actigraphy objects % % R = ACTI(DATA, 'Epoch', epochVal) returns an ACTI object % containing the data in DATA. EPOCHVAL determines how many seconds % one point stands for. Note that the EPOCH property is immutable. % R = ACTI(..., 'StartTime'...
c71a094460d0bea2f95204f4a18c9cf3bf1bd17d418ea63c5d492ded0b6cbd48
MATLAB
6,520
114
% Extract single HRF from dcNew variable, the output of GLM fitting function % save to mat file. function createSingleTrialHRF_Updated(sbjNum,respData,numClasses) %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir = ['C:\Users...
925565cb415aa82fe75729569a5f6972768a292af097b27ca946ca1da09f580f
MATLAB
6,524
164
function as = analysis_step2(params, as, step1, iFile) info_table=params.info_table; info_struct = params.info_struct; info_fields = fieldnames(info_struct); nFields = max(size(info_fields)); [r_res,~]=size(as.metadata); if (iFile==1), i_res=0; else, i_res=r_res; end t = step1....
110eb01bdea7ee8061ae5519d6916665ba9c9a91dac079e67e6f8b6e91f57b98
MATLAB
6,532
202
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Written by James N Ingram, 2023 clear all; close all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Current to Torque gain and offset calculated from: TeenScienceSingleAxisCalibration.m CurrentTorqu...
57fdf4cc073d13e0d30183cf874b95300c627ea75d49df24e92645b6a70a1c9a
MATLAB
6,534
174
function varargout = load_data(varargin) % LOAD_DATA M-file for load_data.fig % LOAD_DATA, by itself, creates a new LOAD_DATA or raises the existing % singleton*. % % H = LOAD_DATA returns the handle to a new LOAD_DATA or the handle to % the existing singleton*. % % LOAD_DATA('CALLBACK'...
0a7fad69c8ebc8ed354135b4c5e95f13d09614e9177f076689160d3ac3ae3aa5
MATLAB
6,539
196
clear all load ('C:\noga\TD complex spike analysis\task_info'); tasks = {'saccade_8_dir_75and25','pursuit_8_dir_75and25'} req_params.grade = 7; req_params.ID = 4000:5000; req_params.remove_question_marks = 1; req_params.num_trials = 20; cell_type1 = 'CRB|PC ss'; cell_type2 = 'CRB|PC ss'; pairs = []; counter = 0; for ...
b38de0ac1187f8096b32add899b3a53f5a9e3b4514fc00df772ae9f7c40d38c1
MATLAB
6,550
173
% function [out, regressor_names] = display_regressor_names(beta_loc, compress) % % This function gives you an overview over the possible regressor names % that can be used as labels for a decoding analysis. This is helpful if % you don't want to look inside the SPM.mat (e.g. with the SPM GUI) or do % not have the...
b7ac4315c30b1066eaccd8a4154ef1b875ef216becf860512a71bafd69e1bb09
MATLAB
6,550
139
function phantom_lcmv_job MNI_roi = [40 -20 50]; % this is the simulated dipole of interest D = spm_eeg_load('D:\home\Data\4AshO\Phantom Images\ROI_sim.mat'); %% S = []; S.D = D; S.tsss = 0; S.t_window = 5; S.xspace = 0; D2 = tsss_spm_enm(S); %% trans ...
a1a82c7c07fd77edf5d7197069058a7477bfc8395b5ad5da97279aecafa020f4
MATLAB
6,559
110
%Performs ERP analysis on spep preprocessed LFP. %2024/02/25 function spep_ERPanalysis(fnames) %define filenames and load data: outputFolder=[fnames.preprocdata_folder '/LFP/spep_erp']; disp('Loading trials timestamp data...') load(fnames.trials_filename); %run ERP analysis: if ~exist...
8cbce6686ee17992643f3b7f5d7fa494fd0d4cbccabc962f85f8854e4d6cce5b
MATLAB
6,562
189
function [comdlgrm, comdlgrm_z, phase2power] = cfc_tort_comodulogram(datMat,srate,n_surrogates,n_bins,LF_steps,LF_bw,HF_steps,tcutEdge) %% [comdlgrm, comdlgrm_z] = cfc_tort_comodulogram(LFP,fs,n_surrogates,n_bins,LF_steps,LF_bw,HF_steps,tcutEdge) % % Compute PAC comodulogram with Tort's method (Tort et al, 2009, 2010)...
a1168ffa5cd38054bd2a8fe836712a2a27df03437ab0e9c80698d3630396d53f
MATLAB
6,578
181
for q = 1:2 filename = sprintf('/Translation/Ai148_AAV-Grm6Cre_Translation_%s_%d%03d', Daystr, Cel, expids(q)); load([NatMovPath filename], 'I'); Mov = std(I, [], 3); Mov = Mov/quantile(Mov(:), 0.99); savename = sprintf('Ai148_AAV-Grm6Cre_CPRegistration_%s_%d%03d.mat', Daystr, Cel, expids(q)); ...
59c56128eff711bbf63b45ea024f7cb453aae306de5b68f7589878597aa64912
MATLAB
6,579
111
% function [n_decodings,decoding_subindex] = get_n_decodings(cfg,mask_index,mask_index_each,sz) % % This is a subfunction of The Decoding Toolbox. It determines number of % times a full classification is performed (e.g. number of searchlights or % number of ROIs). % % Martin Hebart & Kai G?rgen, 2013 functio...
ad2661dd7f5fffbe72d0d0d2afd746e8dc378becbbea192fd1844522682fca0e
MATLAB
6,587
206
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Supp Fig9 CFstimulation" % 3. Using ctrl+enter within each function to run each section %% Section 1: Open files % 1. ctrl+enter to run this section % 2. analyze the data within the folder of "Supp Fig9 CFstimulation...
88bbc4215983759458bb9decc60aefb14aeb8b6818f7afc92dc499af2c117961
MATLAB
6,591
192
%% Main Flow Tracking Analysis Script % The goal of this analysis is to track actin dynamics in actin % fluorescence movies using Optical Flow and Crocker-Grier Least-Squares % Minimization Particle Tracking. clear % close all clc %% Define Global Parameters % % % % % --------- File Parameters --------- % % % ...
9905e7d4ec44d7600d7824019adc14607800c851e7164f16b28badab5acc729e
MATLAB
6,598
158
%CALCULATE THE EXPECTED SHAPE DISTORTION BASED ON SLANT PERCIEVED %I am estimating the aspect ratio based on the reported slants %that people percieved in the experiment. We take into account inferences %from disparity and the retinal image shape. %order the slants so that the shape estimation is ready to plot a...
a5bec967556e2b05fc409837315ce169998e6f53dd928363381320b9429df722
MATLAB
6,599
176
%% Main Flow Tracking Analysis Script % The goal of this analysis is to track actin dynamics in actin % fluorescence movies using Optical Flow and Crocker-Grier Least-Squares % Minimization Particle Tracking. function MainAnalysisScript_GuvenPaperModified(fileParameters, mainAnalysisParams) %% Start MainAnalysisScri...
abe7791b46df13c0fccedb22c280e4865574d08a558f54e9ebba4668c6d3c102
MATLAB
6,618
216
%for plotting averages of all dff traces in a condition as well as %standard error shading %requires https://www.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m %Use after THexporttraces_xlsx.m and THGCaMP_ampsdffsingle.m prompt='How many traces?'; blank=input(prompt); %decide how many data sets you want...
77490ee344217859d34e9b5232c7dc4a1690853e80db0ae4eba036bb5dd7beb0
MATLAB
6,629
217
%%%%%% STARTING with just CB data! participant_CB_3_mo_dir = '/Users/tawnytsang/Desktop/Projects/ETdataFiles/infantSibs/CB-SST Data/matlab/CB/3/'; participant_CB_6_mo_dir = '/Users/tawnytsang/Desktop/Projects/ETdataFiles/infantSibs/CB-SST Data/matlab/CB/6/'; participant_CB_9_mo_dir = '/Users/tawnytsang/Desktop/Project...
923a3acefe0f75f8b77e167eabae2ee541c0edae728f05003c98ed037f1db454
MATLAB
6,635
207
%% addpath('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BasicFunctions'); nIter = 5000; %% IsEncodingSpace = 1; if IsEncodingSpace cResp = Y(:, 1:3); else cResp = Resp; end TypeDiff_val = nan(nType, nType); TypeDiff_p = nan(nType, nType); rng('shuffle'); for i = 1:nType for j = 1:...
300f35acd3a64bcdcc193974a1bd60da93d0510bb5d31f553e49e05a0fca051f
MATLAB
6,637
195
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % params output_filename = "ext_dir_in...
ba2e233f0935fae2806bf6e439315f7fc882901e7cb66044969cc0ad28b46cba
MATLAB
6,640
106
function [XSecBinsPrePost_PermMean,XSecBinsChangeAvgBaseline_PermMean] = MeanFt_XSecStatBins_PermEventOnsetByAreaBand(mydata, CONDITION, TSERIES,... time_window, ExcludeBaseline, perm_num, param_name, WhichEvents, NBinsPre, NBinsPost,... AB, lmk_idx, bin) % MeanFt_XSecStatBins_PermEventOnsetByAreaBand modifi...
8729ba6d91edf0e49863b4ec3a8828e8fb19702d6829a25e3e844f0cf794e7ad
MATLAB
6,644
205
classdef MetaDataTagsClass < FileLoadSaveClass properties tags end methods % ------------------------------------------------------- function obj = MetaDataTagsClass(varargin) % Set class properties not part of the SNIRF format obj.SetFileFormat('h...
63a8aa638d5ca9e97a544aa838cadf9ab1dd379e411e391d73ceaed604e2cc5c
MATLAB
6,648
138
% function [cfg,trans_results,data_train_trans,data_test_trans] = decoding_transform_features(cfg,data_train,data_test) % % This function transforms features of decoding data and is an integral % part of the decoding toolbox. This function is called from decoding.m % and should not be called directly. Feature tr...
804ad2882b0153106626e8c784587a804607105ec2eb54faa14198a424ef3822
MATLAB
6,649
232
clear; clc [task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis'); POPULATIONS = {'BG|SNR','BG|SNR';... 'BG|SNR','PC ss|CRB';... 'PC ss|CRB','PC ss|CRB'}; BIN_SIZE_FOR_NOISE = 100; EPOCH = 'cue'; raster_params.time_before = 199; raster_params.time_after = 800; raster_params.smoothing_margins = 200; raste...
d7b5486f2d2f9f31872cc1f882f36b441dae09037652889c97095dd7ff21d630
MATLAB
6,654
230
%% Figure 3A - VSD Response Timeline % Size: 8x6 % load('M16D20160203_Orimask_OriMask.mat'); BLK = WideField.BLKPlus('Data/M16D20160127_Orimask_StabDown004.mat','Data/M16D20160127_Orimask_TS.mat'); BLANK = BLK.getDataTrial('TypeCond',0); BLANK = BLANK - mean(BLANK,4); BLANK = reshape(BLANK,size(BLANK,1),size(...
f0b9b400c8d8e043cdfe9b5f743c60d3d6001aab9b831daf30a8bdd4ac78515a
MATLAB
6,662
239
% tCFS_E3_figure4_v2 % this version condenses the plots to include example trials: % job=[]; % job.concatGFX= 1; % job.plotPFX=0; % job.plotGFX=0; % plotType==1; % as per other MS figure %% set up some directories. % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop\track...
457dcb6822b76cca0b1c3744cd14668da5bd36cfaeaf34bb6f086c5cd6089624
MATLAB
6,667
216
function PLS_bootstrap(GENEdata_root, MRIdata_root, ncomp, bootnum, working_dir) % PLS regression and boostrapping %% ------------------------- SCRIPT INFORMATION --------------------------- % % PLS Regression and bootstrapping % % This script will perform a PLS regression analysis for relative gene % expression in 180...
816ada8f67585ef24448de654b54dccef5340308f8bc5285a830fc47f9399818
MATLAB
6,667
234
function rendersurface_aal90_gifti(aalvector, symm, rangemin, rangemax, inv, clmap, surfacetype) % script to render aal90 on inflated brain % ML Kringelbach April 2020 % % Parameters: % % aalvector : 1x90 vector % % symm : 1 if ordering is symmetrical % rangemin, rangemax : limits for colorscheme % % inv : % 0 colo...
9cb4f4086a8323fdfc8b89975c895fb271ce123ac74b72d1266d5a2b910230e2
MATLAB
6,674
170
%% Read data from DRC analysis results % and compile into a table "data" % columns include: sp,np,err,PRF,CGF,wtf_reg_params, wtauphi_reg_params, % strfpp, ctxtpp function [data,pairTable] = DRC_load_data() % datapaths % STRF parameters K = 61; J = 8; freq = logspace(log10(2),log10(64),K); delay = 5....
36077c456f91f45d09825ce06b58c0993fb39217a2be8ac97eadd234bae8c90e
MATLAB
6,677
202
% Run after @GenerateExpectedGC6fResponseNoise % Get the filename for the batch loop clear; close all; clc; ChopClipL = 60; UpSamplingFz = 100; Txcorr = [-95 -5]; radius = 40; % Addnoise = 0.002; IsDisplay = 0; %% load comparison grids Topic = 'Ai148_Grm6Cre'; Day = '110318'; Cell = 1; Exp = 5; NoisePath ...
d1ac9d7bdb34f3575aaa63d643f863234347a85d7416ebf275b98a52d6161bae
MATLAB
6,684
196
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This code was written by Dr Petra Vértes and is taken from Whitaker and Vértes, PNAS 2016 % please cite that paper if you this code in your own work. % % Jin Liu modified to fit the data in this study % 20...
d3a7dd0b152034550626b95fe19315a325fe1a8b4539aeb78a09a0c06b47658a
MATLAB
6,685
230
function [F0,Fn,Zn,F] = EPG_GRE(theta,phi,TR,T1,T2,varargin) % [F0,Fn,Zn,F] = EPG_GRE(theta,phi,TR,T1,T2,varargin) % % Single pool EPG (classic version) for gradient echo sequences % % arguments: % theta: vector of flip angles (rad) - length = #pulses % phi: phase pe...
d8b80670f2e3ea55e570d771f106bf687f3ec55fe5129b38916ab59449694490
MATLAB
6,692
233
clear; clc [task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis'); POPULATIONS = {'BG msn|SNR','BG msn|SNR';... 'BG msn|SNR','PC ss|CRB';... 'PC ss|CRB','PC ss|CRB'}; BIN_SIZE = 100; SHIFT_CONTROL = 1; INCLUDE_PREV_OUTCOME = true; raster_params.time_before = 199; raster_params.time_after = 800; raster_para...
5cb3ea226185e278e574fa0354d77ce88b6079b8c6d2eb5bfd84151b433da666
MATLAB
6,698
231
function rendersurface_schaefer1000(schaefer1000vector,rangemin,rangemax, inv,clmap,surfacetype) % script for rendering a schaefer1000vector % ML Kringelbach April 2020 % schaefer1000vector : the schaefer1000vector values to be rendered % % rangemin, rangemax : limits for colorscheme % % inv: % 0 colormap, interp % ...
d2a1a751b10000aa6d236beea830d87240a9c35f2bf376b0b34ef26d9f7d2092
MATLAB
6,698
171
%% Bar Plot of d' and LR Bias (Pooled + JK errorbars) %% Code monkey = ["G","B"]; global Trials Trials = ["All","RF"]; parameter = ["sens","LR","MB"]; sessions_list = {[4:15 18 20:24], [34:45]}; flag_scatter = 0; for RF = 0:1 par_all = cell(1,2); par_all_mi = cell(1,2); par_jk = ...
e6fe3a72fe6181eeb49affd6f66b8a35ce97700bb0a04f184f33a0b01bb78e49
MATLAB
6,699
265
function [errmsgs warnmsgs] = unit_create_adj_list(varargin) % This is a script that tests the adjacency list code. % % [ERRMSGS WARNMSGS] = UNIT_GET_ADJACENCY(...) % % INPUT ARGUMENTS: % % STDOUT (optional, default = true) If true, prints errors and % warnings to screen as they occur. % % OUTPUT ARGUMENTS: % % ERRM...
bcb8379cc278cdeac80756f0e4072fd36c88b254fbfec669d356adfd9757c228
MATLAB
6,707
166
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This code was written by Dr Petra Vértes and is taken from Whitaker and Vértes, PNAS 2016 % please cite that paper if you this code in your own work. % % Jin Liu modified to fit the data format in this stud...
18b489aaf9032cb47af77213ad4152dfc303add6e362af61e564310670c6d46d
MATLAB
6,710
188
clear; close all; clc; %% position = -40:4:40; radius = 40; % in um pixel2um = 2; nonlineartype = 1; % std [X, Y] = meshgrid(position, position); gridposi = [X(:), Y(:)]/pixel2um; ngridposi = size(gridposi, 1); Act = @(MaxAmp, Alpha, Tau_r, Tau_f, t) MaxAmp * Alpha * (exp(- t/Tau_f) - exp(- t/Tau_r)) /(Tau...
eada55a5ca5c7a518fe8c75245837370185247ecd393c1d55f9ea28fde66cea2
MATLAB
6,712
225
%% Test 4: Comparison of multislice and single slice TSE % 2017-09-13 % version 2 - multiple slices as per in-vivo experiments addpath(genpath('EPGX-src')) addpath(genpath('lib')) %%% Sequence %%% Number of refocusing pulses nrefocus = 25; %%% have 8 different scenarios nslice = 1:2:15; nn = length(nsl...