sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
7d6e6b20d8087e589cfb3db61281e8f4e47565918cabeb561b1fb22f9c95a408 | MATLAB | 15,517 | 331 | classdef biChordChart < handle
% Copyright (c) 2022-2023, Zhaoxu Liu / slandarer
% =========================================================================
% @author : slandarer
% 公众号 : slandarer随笔
% 知乎 : slandarer
% -------------------------------------------------------------------------
% Zhaoxu Liu / slandarer... |
867dc9314d203a14d35254395376167ca089273f4fa9ca6e93b02785faebaf84 | MATLAB | 15,636 | 363 | function [] = testing_cross_validation_for_paper()
% Function to assess the validity of statistical testing in Adam White's
% first machine learnig paper.
% Set-up a classification problem under the null, perform k fold
% cross validation, with a lock-box, as per Adam's approach. Test a range
% of different st... |
794e0c3ee7f0ec9c30083b2b35cdd87f0b92779be81640b64edf537c93d1f9f2 | MATLAB | 15,637 | 459 | function [mri] = ft_read_mri(filename, varargin)
% FT_READ_MRI reads anatomical and functional MRI data from different
% file formats. The output data is structured in such a way that it is
% comparable to a FieldTrip source reconstruction.
%
% Use as
% [mri] = ft_read_mri(filename)
%
% Additional options should be ... |
7165d0aaba8ff361bf80b472a515e4f42ca8a895c60b65964571a8e157cfd4c3 | MATLAB | 15,654 | 392 | % Performs sample size calculations, with optional correction for the design
% effect deviating from unity.
%
% -- Function File: N = sampszcalc (TESTTYPE, EFFSZ)
% -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW)
% -- Function File: N = sampszcalc (TESTTYPE, EFFSZ, POW, ALPHA)
% -- Function File: N = sampszcalc... |
0ba26f69c303cf56aeeace31d9023a5eca00deb5a381b71a3a7a7275c1c8c7c7 | MATLAB | 15,674 | 335 | %% clear the workspace and select data
warning off;
gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
list_data_names={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'};
list_ID_part = {'_part11', '_part12', '_part21', '_part22'};
list_patch_dims = [120,120; ... |
c75ab0b2689be7077f6322100d01533afa146780e23543ec645201a33f2a7669 | MATLAB | 15,741 | 436 | function script11_plot_fods()
% plot skeletons and FOD
%
% This script needs the results from script:
% script06_axon_diam_skel_props.m
% script09_fods_dispersion.m
% and the information in the .mat files in the folder
% cc_cg_labels/
% The results of this script will be saved in folder
% White_matter_EM_06_... |
d6990450693b6e80a762dc6c6595acee77dccf9a33fc2e8f81d33ca37bc52163 | MATLAB | 15,764 | 491 | %% Figure Script for the Eigenvalue Derivative Analysis
%% Setup Data:
scale = 200;
filename = 'MICA_schaefer200_SCFC_struct.mat';
load(filename);
n_subjects = length(MICA);
nroi = length(MICA(1).SC);
SC_all = zeros(nroi,nroi, n_subjects);
for i = 1:n_subjects
SC = MICA(i).SC;
SC = SC./n... |
b217f90c3b5e0496a21bab9bdbb2668071e408634496e5c3f54b67ddcb6fbaac | MATLAB | 15,772 | 336 | %% clear the workspace and select data
warning off;
gcp;
addpath(genpath('.'))
addpath(genpath('../ANE'))
clear; clc; close all;
%%
list_data_names={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'};
list_ID_part = {'_part11', '_part12', '_part21', '_part22'};
list_patch_dims = [120,120; ... |
12b355dc9235a8e8101712c0ab8affb957874d980a0a293d4039f10dddd51479 | MATLAB | 15,775 | 385 | function [emm] = emmeans(fitmodel, varargin)
% Estimate marginal means
% NOTE: this function only works with models that contain no categorical-continuous interactions.
%
% Surprisingly, GeneralizedLinearMixedModel class does not store whether
% the model was fit using OFFSET. so the user must indicate this.
% ... |
aeb0135234c6a5671f925767fa1907e25eab1440c429d7a1dc5e83100c1697f5 | MATLAB | 15,800 | 496 | function [b0,Dlm,Wlm,Dl,Wl,DTI_scalars,DKI_scalars,ExtraScalars] = Fit_DKI_LTE(DWI,b,dirs, mask, computeExtra)
% [b0,Dlm,Wlm,Dl,Wl,DTI_scalars,DKI_scalars,ExtraScalars] = Fit_DKI_LTE(DWI,b,dirs, mask, computeExtra)
%
% This function fits DKI on a 4D diffusion dataset (x y z ndwis)
%
% Parameter estimation:
% WLLS estim... |
548b1b0b1d52055480b3ac8536a320e3828e7959901dd2bb97e3430350c10330 | MATLAB | 15,807 | 438 | clear all
close all
clc
%% Behavioral Data analysis
% 01/16/2022
% Daniel Sazhin
% This script takes a participant's responses and collapses them into a
% dollar amount for analysis.
% This script is to deal with two subjects with different input folders.
% Update the subjects list with up-to-date subjects
maindi... |
6c29bb019c9b9338cca278d38cb234e74f4c7d95b66ff84b2a963443afd7dff8 | MATLAB | 15,809 | 467 | function[data,h]=SONGetRealWaveChannel(fid, chan, varargin)
% SONGETREALWAVECHANNEL reads an ADC (waveform) channel from a SON file.
%
% [DATA {, HEADER}]=SONGETREALWAVECHANNEL(FID,...
% CHAN{, START{, STOP{, OPTIONS}}})
% FID is the matlab file handle, CHAN is the channel number (1=max)
%
... |
4c061a138a015c40f7b141fc7295841f7e4b81b2cbd762fe3026ccfbf846e487 | MATLAB | 15,814 | 334 |
%function [Spikes,nose,Fs]=getSpikesOF(File);
%getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct
%2016
%
%1. parse the data according to gaps in Timestamps (> 1s)
%Session_str, e.g.,'20150906Thalamus36\20150906Thalamus36_1to...'
%
%Spikes{Nelecs,Nunits}, cell holding spike times in ms fr... |
fe0c333ebea13fafea4fcc7ba5dba86e39a81e244cadee7c2ae501ae07b6d51e | MATLAB | 15,817 | 470 | % This analysis is taking the spiking rate during a specified period of
% time and averaging over that period. This will give us an aggregate
% number that will be able to be used for a regression/ttest analysis
% looking at the differences between social and nonsocial and informative
% and noninformative.
switch Anal... |
48ea3b7417c4bb27bef817348622170dd1215e6059248df4f3179c8cf9d45675 | MATLAB | 15,830 | 300 | %%
%% CHALLENGING AGE-RELATED DECLINE IN BRAIN FUNCTION: EVIDENCE FROM FAST NEUROIMAGING OF MUSICAL SEQUENCE RECOGNITION - TEMPSEQAGES 2021 - LEONARDO BONETTI
%%
%% LOCAL COMPUTER - REVISION I - COMMUNICATIONS BIOLOGY
%This code was used locally to prepare plots with higher resolution compared to the solutions offe... |
f15b9608e4385a393db9a9d6a52998b627d4d043a90361d36e48d6ee2f0e5fcb | MATLAB | 15,887 | 386 | function [emm] = emmeans(fitmodel, varargin)
% Estimate marginal means
% NOTE: this function only works with models that contain no categorical-continuous interactions.
%
% Surprisingly, GeneralizedLinearMixedModel class does not store whether
% the model was fit using OFFSET. so the user must indicate this.
% ... |
4bff27534a953e7222e8f6449a93dfdfb4385fe9229f56eb731e654899b1da71 | MATLAB | 15,891 | 364 | function [m, filename, imaxf, imeanf, pixh, pixw, nf, imx1, imn1] = data_cat(path_name, file_base, file_fmt, Fsi, Fsi_new, ratio, ttype)
% Concatinate data pieces from raw 4GB-tif chunks,
% new tiff files,
% or avi files from UCLA miniscope
% parallel or serial version supported
% Jinghao Lu 01/16/2016
hca... |
b195b82dd400b3962862b88daedd04a7a9e2b7d37302f2c76b33d61d57ebc64e | MATLAB | 15,989 | 494 | clear all
close all
clc
%% Behavioral Data analysis
% 03/29/2020
% Daniel Sazhin
% Temple University
% ISTART Project
% This script takes a participant's responses from log files in ISTART and collapses them into a
% dollar amount for analysis.
% Use ID_Scores.m to generate covariates for L3
% analysis in FSL.
% ... |
e0127f227929fcfe016ac633d2da8099456f4a5da35cd2c765923a127fc1e3b9 | MATLAB | 16,025 | 391 | function [data_epoch_nirs, data_epoch_motion] = define_trials(run, ID, vis, z_score)
% DEFINE_TRIALS
% This function segments the data into trials and adds info about each trial
%
% INPUT:
% - run: matlab structure containing the raw nirs & motion data of each run
% - ID: participant-ID of the run that is currently loa... |
84a8437d02ca09b092271ab7a7896c08b5e7c0ee048a4e056e77b2827941da65 | MATLAB | 16,036 | 379 | % extractEphysKernelsSelectPData.m
%
% Function to compute kernels and autocorrelation for multiple pData files
% from a single fly. Relates spike rate and median filtered Vm and FicTrac
% parameters: forward velocity, yaw velocity, yaw speed, total speed, and
% slide velocity.
% Operates only when fly is moving
%... |
c6a097f91d879a4ceccee339d496cfc8dc82b68ad194fcfd99d99324aa6468eb | MATLAB | 16,038 | 281 | function [U] = lfmm3d(eps,srcinfo,pg,targ,pgt)
%
%
% This subroutine computes the N-body Laplace
% interactions and its gradients in three dimensions where
% the interaction kernel is given by $1/r$
%
% u(x) = \sum_{j=1}^{N} c_{j} \frac{1}{\|x-x_{j}\|} -
% v_{j} \cdot \nabla \left( \frac{1}{\|x-x_{j}\|}\r... |
72a7b979eb77d62ef25151492f4f053c2d8013288e07abeff86cc694f311a20a | MATLAB | 16,069 | 348 | %% Author: Jiri van Bergen and Xu Li
% Affiliation: Radiology @ JHU - Kirby Center
% Contact via xuli@mri.jhu.edu
% Updated by Xu Li, 2019-07-09
% Updated by Xu Li, 2019-09-07, Added LapPhaseCorrection
% Updated by Xu Li, 2020-10-16, Updated with new phase_unwrap_laplacian
% Updated 2021-06-27 X.L., cluster ver... |
ace876ce7337ff1eace68d4f64ffc5f45246966e6cf5e7f7ef6b1dde773264ea | MATLAB | 16,111 | 304 | %Computes averages and stats across the whole dataset
%Requires the data structure from the other mains script for this project.
%Written by Mitchell Prostebby, 2023
nRec = 32;
for i = 1:33
% for i = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33]
rsp(:,i) = annettes... |
b6fa723242da0eeb118ce271d1616f3843ab523a511d4475606b0181bc72715f | MATLAB | 16,153 | 375 | % saveAEPPEPbyCond_fly.m
%
% Function that takes in user selected pData files (for 1 fly) on which
% sortLegStepsByIInj or sortLegStepsByOpto has been run and saves mean,
% and std dev for AEPs and PEPs for each condition for that fly
% Can condition on a value of legStep params
%
% INPUTS:
% stim - struct of para... |
3b4cd7a7b3fb78cc1e688f9c04a00332fc37a59ce3c66ca1194b7e3ba47ad463 | MATLAB | 16,161 | 307 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function main_analysis_group_averages_plot(analysisSettings, plottingSettings, analysisResultsGroupAverages)
plot_and_save_normal_bfo90_all(analysisSettings, analysisResultsGroupAverages, plottingSettings);
plot_and_save... |
9289ea10001794d7bb78629ca6214de05b3abffff674f9c9e8da64310352adfd | MATLAB | 16,170 | 496 | function data = loadjson(fname,varargin)
%
% data=loadjson(fname,opt)
% or
% data=loadjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% authors:Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
% created on 2011/09/09, including previous works from
%
% ... |
6d9a6ef72fd029d19a69d971c1f8abbb27480dfefe6caf64e3c8f764fb30e069 | MATLAB | 16,171 | 423 | function tree = xml_parser(xmlstr)
% XML (eXtensible Markup Language) Processor
% FORMAT tree = xml_parser(xmlstr)
%
% xmlstr - XML string to parse
% tree - tree structure corresponding to the XML file
%__________________________________________________________________________
%
% xml_parser.m is an XML 1.0 (http:/... |
378cfd1895b1eeafa912a207f4d13efe3baaddb95ecf463c4b611c56eeaba2c7 | MATLAB | 16,184 | 556 | % anovaStats_optoIInj_240509.m
%
% Script to perform ANOVA statistical tests and post-hoc tests for
% manipulation experiments (CsCh and GtACR1 opto and IInj)
%
% CREATED: 5/9/24 - HHY
%
% UPDATED: 5/9/24 - HHY
%
%% DNa02>>SPARC2D-CsCh, non-circular
% as difference from no stim condition
% which parameter
% whichPar... |
5212fcc3f6d0c8ce5c389af7e9109b5b3cbed7f2b976a903ffe4c0694ae2571d | MATLAB | 16,188 | 320 | function [neur_num,neur_num_AD,dend_params] = growApicalDendrites(vol_params, dend_params, neur_num, cellVolumeAD, gp_nuc, gp_soma)
% [neur_num,neur_num_AD,dend_params] = growApicalDendrites(vol_params, dend_params, neur_num, cellVolumeAD, gp_nuc, neur_soma)
%
% Function to grow dendrites in a neural volume. The inpu... |
d27d7b0c0eaa1bd65e1e7942d0b3502e24d298037f1da9752ed27baeb2146a58 | MATLAB | 16,200 | 431 | function varargout = retrack_settings(varargin)
% RETRACK_SETTINGS M-file for retrack_settings.fig
% RETRACK_SETTINGS, by itself, creates a new RETRACK_SETTINGS or raises the existing
% singleton*.
%
% H = RETRACK_SETTINGS returns the handle to a new RETRACK_SETTINGS or the handle to
% the existing ... |
146fc7e1cdb55b4688b75f42ad2e863a11f4460590ade3f6d77c7d7f065d2921 | MATLAB | 16,206 | 270 | function feat = extr_feat_channel(chns, feat_bkg, grids, pts, patchSize, surroundingWidth, nStride)
imh = chns.imh; imw = chns.imw; surrWidth = ceil(surroundingWidth * patchSize);
nPatch = size(grids, 1); gridX = grids(:, 1); gridY = grids(:, 2);
%% extract sift features (gray-channel)
% binSize = floor(patchS... |
6bbb21919a8e68cc5c7bf81a73832405ae8ba0857811818a5fa62740913feba0 | MATLAB | 16,237 | 367 | %% mff_getSummaryInfo.m
% Matlab File
% author Colin Davey
% date 3/2/2012, 12/3/2013
% Copyright 2012, 2013 EGI. All rights reserved.
% Support routine for MFF Matlab code. Not intended to be called directly.
%
% Returns data about the MFF file that is used by the multiple functions
% that read and write MFF ... |
d8106b458566fb84aa2887a34185c6da753b4fee32d6b858d16bafa69390ddbb | MATLAB | 16,280 | 407 | function varargout=preProcessTiles(sectionsToProcess, varargin)
% Load each tile and perform all calculations needed for subsequent quick stitching
%
% function analysesPerformed=preProcessTiles(sectionsToProcess,'param1',val1, ...)
%
%
% PURPOSE
% For the final stitched image to look good we will need to pre-process t... |
13b7de4a6589fc702ff022cc9afa83b88a98dc727f15f65e88d153cbf18cf590 | MATLAB | 16,306 | 268 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
45862e1549d6c9613c2e2a20571a66971afc632a085c97449ce294a0f6dc46df | MATLAB | 16,309 | 398 | % legFictracvidEphysIInj.m
%
% Experimental Function
% For simultaneous acquisition of leg video, FicTrac video,
% electrophysiology recording, and current injection
% Uses background acquisition on DAQ
%
% INPUTS:
% settings - struct of ephys setup settings, from ephysSettings()
% duration - duration of trial, i... |
65c0c00b00bf04599af16e0fef8503bab0208978a5e04334e60bb89c5d201a44 | MATLAB | 16,335 | 278 | %% Conditioning: Plot Decoding error during movement times
animals = {'remy','gus','bernard','fievel'}; %
for a = 1:length(animals)
%epochfilter{1} = ['$ripthresh>=0 & (isequal($environment,''goal'')) & $forageassist==0']; %& $epoch==2
%epochfilter{1} = ['$session==6 & isequal($environment,''goal'')'];... |
92dec62bdc1590a96f0c062cd201e65579664eb4e5eedd85946d02e6b416d13f | MATLAB | 16,350 | 274 | function core_tracker(output_track_file_name, ...
output_calibration_file_name, ...
output_background_file_name, ...
output_features_file_name, ...
output_features_csv_folder_name, ...
output_jaaba_folder_name,... |
6b7e9ac972df23ca723ac3a83e939aa2c87a688ae58a2c0b8ca8455ecb3e6721 | MATLAB | 16,408 | 392 | function tensorfitting(root,outdir,detectoutliers,cumulants,dti,dki,wmti,fitconstraints,akc,DKIroot,fitWDKI,smooth)
addpath(genpath(DKIroot));
% if isempty(gcp('nocreate'))
% pc = parcluster('local');
% pc.JobStorageLocation = '/cbi05data/data1/Hamster/scratch';
% nw = 12;
... |
42c6957364043a820e32745bf557f74dd01b617aa2a2b1aa5a5988352d4a8063 | MATLAB | 16,414 | 509 | function varargout = IMGUI(varargin)
% IMGUI(IMG,SCALE,TIME)
% IMG=[4D Time Series] (It won't crash for 3D time series either)
% SCALE = [min(IMG(:) max(IMG(:))] Colorbar scale
% TIME=[size(IMG,4),1] Time series with the same length as the 4th column
% of IMG
%
% Arrow Key Commands
% The arrow keys can be used to tra... |
3ba5188123d922777579f745fd5941cd72f07a3dafb505ca1583da8c21b58db7 | MATLAB | 16,440 | 530 | function json=saveubjson(rootname,obj,varargin)
%
% json=saveubjson(rootname,obj,filename)
% or
% json=saveubjson(rootname,obj,opt)
% json=saveubjson(rootname,obj,'param1',value1,'param2',value2,...)
%
% convert a MATLAB object (cell, struct or array) into a Universal
% Binary JSON (UBJSON) binary string
%
% author... |
2ae02de8cc1c54b4aca8b3eaf4041704aa17b1e116068e59860f7d7239392bcf | MATLAB | 16,484 | 430 | clc
clear
%% Loading the Data for Model Development
% This code develops dynamic (hybrid series NLS - NLD) MCNN models for the
% case when a time-invariant bias with / without Gaussian noise is added to
% true data to generate training data. The other type of hybrid series MCNN
% i.e., NLD - NLS model can ... |
fd7224279926a06cc8f30bb239b62f03f6f9e8d976a42982faa8c3ca53962fcd | MATLAB | 16,489 | 436 | function [dat] = read_edf(filename, hdr, begsample, endsample, chanindx)
% READ_EDF reads specified samples from an EDF continous datafile
% It neglects all trial boundaries as if the data was acquired in
% non-continous mode.
%
% Use as
% [hdr] = read_edf(filename);
% where
% filename name of the datafile... |
5610a9b33490e196b7528cc69f943163190dea5ad5ca94c757403ec0a98f26c7 | MATLAB | 16,510 | 508 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This makes Figure S4, which is of the BFO90 results for the dig pairs.
close all
clear all
clc
% Paths
run('../load_figure_config.m')
INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER;
OUTPUT_FOLDER = CHENGS_TASK_2C_FIGURES... |
00fe0d1066a044b4d203c1295d05f2eb30be285e598c2fe484f778a1cc826463 | MATLAB | 16,523 | 320 | %RNAscopeAnalysis
%Code to load excel data exported from QuPath and analyze in Matlab for
%automated quantification and summary.
%See Ryan et al., 2024 - Figure 4L,M; Figure S5D
%Written by Michael B. Ryan - October 16th, 2023
%% Load QuPath data into struct
%Set path for folder with all animal data - each an... |
cbed6d23d9bcfff716999bd0e91639cebcd9c1925559c448cff31a2aebf42407 | MATLAB | 16,555 | 1 | function B=inpaint_nans(A,method)
% INPAINT_NANS: in-paints over nans in an array
% usage: B=INPAINT_NANS(A) % default method
% usage: B=INPAINT_NANS(A,method) % specify method used
%
% Solves approximation to one of several pdes to
% interpolate and extrapolate holes in an array
%
% arguments (input):
% A... |
b97dafd99f310866248bd51edda10dee13d850244019d94894c4b611ad61bfc0 | MATLAB | 16,572 | 330 | function [] = getStimROIsFromRetinotopy(projectDir, subjnr, varargin)
% Function to get pRFs with center falling within stimulus corner and
% within 4 individual squares.
%
% Step 1. Run this function, save only large ROIS (saveLargeROIs=true, saveSmallROIs=false).
% Step 2. Check ROIs on indiv subject surface, and ma... |
47dd46b38bc5d041fdd8c83279546d498b8d42fb1819f5826797eade2ee2d31c | MATLAB | 16,581 | 431 | function cfg_detector_set=st_get_default_detector_set(cfg)
% ST_GET_DEFAULT_DETECTOR_SET returns a default "detector set" (=collection of artifact detectors),
% which can be supplied to st_run_detector_set.
%
% Use as:
% detector_set=st_get_default_detector_set(cfg)
%
% Required configuration parameters:
... |
9d780112b929cb312521e546dc105980e25474732b027e53d5006951e3f991a6 | MATLAB | 16,586 | 301 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [analysisResults] = main_analysis_compute_tables(analysisSettings, analysisInput)
isCalciumData = analysisSettings.IS_CALCIUM_DATA;
MapsData = analysisInput.MapsData;
MapsSquareData = analysisInput.MapsSqua... |
c0f28cd3b2cda8fcb117bddaf4bed6dd969079aeb94c8a071d720b0946621d4e | MATLAB | 16,605 | 562 | function Answer=zinputdlg(Prompt, Title, NumLines, DefAns, Resize)
% A copy of inputdlg.m , modified to have better looking font settings
%ZINPUTDLG Input dialog box.
% ANSWER = ZINPUTDLG(PROMPT) creates a modal dialog box that returns user
% input for multiple prompts in the cell array ANSWER. PROMPT is a cell
% ar... |
2ccc288c035d88c06d2cbc19624f1ebac40f79469e44c6d9e4d02a4778a78180 | MATLAB | 16,647 | 670 | function DATA = aedes_data_read(filename,varargin)
% AEDES_DATA_READ - Read various image data formats to data structure
%
%
% Synopsis:
% DATA=aedes_data_read(filename,file_format,default_dir,varargin)
%
% or
%
% DATA=aedes_data_read; % (interactive mode, opens a file dialog)
%
% Descript... |
63e1106d4564d491621963c49dab590444988b8f2663b5989cfd456f4f7b924f | MATLAB | 16,654 | 412 | function tensorfitting(dwi,mask,bvec,bval,root,outdir,detectoutliers,cumulants,dti,dki,wmti,fitconstraints,akc,DKIroot,fitWDKI,smooth,robust,Jrobust)
addpath(genpath(DKIroot));
if isempty(gcp('nocreate'))
pc = parcluster('local');
pc.JobStorageLocation = '/cbi05data/data1/Hamster/scr... |
bac65b35f18f7d6b0c8428098bee3e0c49ba780427b559bae4fb321d588f42d6 | MATLAB | 16,656 | 489 | % Track mouse behavior from the Images
% Author: Maria Chernysheva. Modified from "MouseActivity5" by Renzhi Han
% from Affiliation: The Ohio State University
clc; % clear the comman window
close all; % close all figures
clear; % erase all existing variables
MouseName='m033';
Folder='Y:\Chernysheva Maria\Fibe... |
aaa27e590c935650446fe7ff751625ebf7ef5278611a50f82fe86d3625789274 | MATLAB | 16,668 | 389 | function [ avw, machine ] = avw_hdr_read(fileprefix, machine, verbose)
% avw_hdr_read - read Analyze format data header (*.hdr)
%
% [ avw, machine ] = avw_hdr_read(fileprefix, [machine], [verbose])
%
% fileprefix - string filename (without .hdr); the file name
% can be given as a full path or relative to ... |
41ed69b5d0f8a6476a777d5cbf9260db46382a2871251ef11bb763f1745d4451 | MATLAB | 16,674 | 402 | classdef MLMiniscopeSession < MLSession
%UNTITLED Summary of this class goes here
% Detailed explanation goes here
properties
CellRegResult;
end % properties
methods
function obj = MLMiniscopeSession(config, sessionRecord, name, date, trials, ...
sessionDi... |
1ee3966f0459c07c987159e4e6491be5de7fc6e1c9b849c36512b901dbbce46e | MATLAB | 16,725 | 603 | clear srcinfo
ns = 4000;
srcinfo.sources = rand(3,ns);
srcinfo.charges = rand(1,ns)+1i*rand(1,ns);
nt = 3999;
targ = rand(3,nt);
eps = 1e-5;
ntests = 36;
ipass = zeros(ntests,1);
errs = zeros(ntests,1);
zk = complex(1.1);
ntest = 10;
stmp = srcinfo.sources(:,1:ntest);
ttmp = targ(:,1:ntest);
% Test sources to sou... |
e894367d9d498d7c403a1a13fcd753a121cc3bec2dd8a6192579cbd0a63ad198 | MATLAB | 16,741 | 278 | function allDS = createDataTableMatchedSTRet(projectDir, subjnrs)
%% Load data
roiOrder = [1:6,8:11,7,12,13];
roiNames = {'V1','V2','V3','hV4','VO1','VO2','V3AB','LO1','LO2','TO1','TO2','IPS0','IPS1'};
combROIs = [5,8,10,12]; %VO1/2 (5,6), LO1/2(8,9), TO1/2 (10,11), IPS0/1 (12... |
90f8f0ff5fee29c78eeaa94a5ec7948ccb4cac27829e3a842eac800e5415dbd0 | MATLAB | 16,827 | 353 | function [ img , hdr ] = read_2dseq(path2dseq)
% function [ img , hdr ] = read_2dseq(path2dseq)
%
% This function reads image data in the Bruker format and return it into
% an array where each pixel is in double format. Also, it output the
% spatial resolution (nom_resol) in mm.
%
% Chern-Chyi (Cecil) Yen @ CM... |
6bef8a4d27e760c58306f45f56d166af2b21cf8e3395c9e461cd34cf6f4d1e88 | MATLAB | 16,832 | 243 | function out = dfa_ripcontent(index, excludeperiods, ripdecodes, trials, pos, varargin)
%
% define defaults
appendindex = 0;
box_thresh = .7; % proportion of posterior density in box to be considered box ripple
% process varargin if present and overwrite default values
if (~isempty(varargin))
assign(varargin{:});... |
463795f632cd795f248d4ccfd0bebb16bdc1717a3aa2f57017241cc58b99b850 | MATLAB | 16,884 | 608 | %% Code Outline
% The following code:
% - Applies k-means clustering to BIS scores
% - Calculates the correlation scores for each cluster and task
% condition
% - Calculates energy landscape for each cluster and task
% condition
%% Group clustering
% Load in 'sample_dm.mat'... |
6f5a5d0cf3d258511d214c741d8efb4c6785e492a908c1159d1e47c708e75faa | MATLAB | 16,923 | 344 | function [] = simseq_predictTimeseriesFromToonPRFs(subjnr, projectDir, stimFile, varargin)
% Function to generate temporal model predictions using pRF of single vertex
% from toonotopy experiment.
%
% simseq_predictTimeseriesFromToonPRFs(subjnr, projectDir, varargin)
%
% INPUTS
% subjnr : (int)... |
527d53e97927ac103f431f7d3460b307054756a311e41a2becdf367a151c777c | MATLAB | 16,932 | 448 | function cfg_artifacts=st_run_detector_set(cfg_detector_set,data)
% ST_RUN_DETECTOR_SET applies all detectors in cfg_detector_set (a detector set) to data,
% and returns details of individual artifacts in cfg_artifacts
%
% Use as:
% cfg_artifacts=st_run_detector_set(cfg_detector_set,data)
%
% Required conf... |
eb2d5c8e2fd12851aace573c4289af86271a7187a38f0f931a3ff12910edcd17 | MATLAB | 16,953 | 517 | function[data,h]=SONGetADCChannel(fid, chan, varargin)
% SONGETADCCHANNEL reads an ADC (waveform) channel from a SON file.
%
% [DATA {, HEADER}]=SONGETADCCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}})
% FID is the matlab file handle, CHAN is the channel number (1=max)
%
% [DATA, HEADER]=SONGETADCCHANNEL(FID, 1{, OPTION... |
662e95a2aa6555627d9f31cb84ebef2137a8cb6c161103336bfd96bdb9c624fc | MATLAB | 16,962 | 440 | % visstimEphysOptoVInj.m
%
% Experimental Function
% For simultaneous acquisition of
% electrophysiology data while providing optogenetic stimulation by
% controlling the shutter in front of the mercury lamp for the scope
% (light through objective) and visual stimuli on the G3 panels that when
% in closed loop, ... |
d9d1f6b8570a8afde0bc9ed53d7bb9a16cbe20ae83b5e307e200d52160eda9a5 | MATLAB | 16,973 | 402 | classdef (Sealed) DataStub < handle
%% DATASTUB a standin for readable data that has been written on disk.
% This class is sealed due to special subsref behavior breaking nargout
% expectations for most properties/methods.
properties (SetAccess = protected)
filename;
path;
end
properti... |
4af54abff83c5294d5c2f609dac07f56e2a01df9fb510db45bb710e6ed2ba558 | MATLAB | 17,067 | 237 | % DATA ANALYSIS PIPELINE FOR FIBER PHOTOMETRY EXPERIMENT
% Name: CocaineNAc_PooledQuantification
% Cohort: NAc AllodLightctrl with opto and drugs (DETQ or cocaine)
% Feb 2023 - Marie Labouesse, marie.labouesse@gmail.com
% 1- POOLED QUANTIFICATION
% loads FP data previously analyzed (with: CocaineNAc_DataExtrac... |
af15043ca670bde09a0f282b1e0dc72e5ff41d8a6eb429af557dc47ba131d7f2 | MATLAB | 17,072 | 399 | %% s_compareLMMs.m
% Script to compare goodness of fit for different linear mixed models
% Main LMM: fixed ampl & condition effects + random subject intercept and slope for each condition.
% LMM alternative 0: fixed ampl + 1 random subject intercept (same for each condition).
% LMM alternative 1: fixed ampl & conditio... |
4d3e49b649f924309cc8bce2efbb840cbad1dc5b43fd363cbfdc260bfd698c21 | MATLAB | 17,127 | 456 | function varargout = VOR_GUI(varargin)
% VOR_GUI MATLAB code for VOR_GUI.fig
% VOR_GUI, by itself, creates a new VOR_GUI or raises the existing
% singleton*.
%
% H = VOR_GUI returns the handle to a new VOR_GUI or the handle to
% the existing singleton*.
%
% VOR_G... |
3530818c927baf5109b56f5020c3cf3f1532d80a78807005bd691be542249bb8 | MATLAB | 17,160 | 416 | clear all
close all
addpath('/data/jag/gbaum/matlab_scripts/BCT/2017_01_15_BCT')
addpath('/data/jux/BBL/projects/pncBaumStructFunc/scripts/colorbrewer/cbrewer/cbrewer')
addpath('/data/jux/BBL/projects/pncBaumStructFunc/scripts/colorbrewer/MatPlotLib2.0_colormaps')
addpath('/data/jux/BBL/projects/pncBaumStructFunc/scri... |
6cd8993cf0f8837843f5d2775851d1b26f92f84c9f051a4cec54d733ea240eb8 | MATLAB | 17,238 | 365 | function fH = plotMeanSeqVsSimAmplitude_voxel(ds, fLMM, lmmResults, varargin)
% Function to plot average voxel SEQ block amplitude vs SIM block
% amplitude, colored by pRF size.
%
% From the paper:
% Title: Rethinking simultaneous suppression in visual cortex via
% compressive spatiotemporal population rec... |
ae292627be6c5dca94b743291f816de5633278c80c20dbfbcbb2424e158c0a49 | MATLAB | 17,328 | 480 | function normalize_folder(r)
global figpos
global num_beads
try
[figpos,questpos]=setFigurePositions;
[data_dir, f,num_files]=getFileList;
filenames=strcat(data_dir,f);
timeOrder=orderFilenames(filenames);
filenames=filenames(timeOrder);
f=f(timeOrder);
% -100 subt... |
14e36efd8ef234fbb7c3eed43ec41d9a78d16f5ba33ed7c5c923a939dd0d9cec | MATLAB | 17,336 | 399 | % extractContStepParamsIInj_fly.m
%
% Function to extract continuous leg step parameters with current injection
% stimulation.
% This uses the continuous estimate of the step parameters using the
% envelope method (legStepsCont struct)
% Like extractLegStepParamsIInj_fly(), allows filtering valid IInj trials
% by t... |
42c6bc46bdeee950cc611f1b58c19fc38a7664666039c94f0cf47314d19befba | MATLAB | 17,336 | 346 | function result = postZip(zipPath, cfg, micID, source, varargin)
% Upload a zip to the brainsaw server; never throws
%
% function result = webupload.postZip(zipPath, cfg, micID, source, ...
% 'ConnectTimeout', 5, 'ResponseTimeout', 10, ...
% ... |
ff7ccfbec9d61c4a5386947d387f0507e1bb409c7c22cfbfa6a0434bf51e6d88 | MATLAB | 17,358 | 318 | %% s_prepareSTRetDataForPlotting.m
% Script to prepare data for supplementary figures 8 and 9 in the paper:
% Title: Rethinking simultaneous suppression in visual cortex via
% compressive spatiotemporal population receptive fields.
% Authors: Kupers, Kim, Grill-Spector (2024).
% Journal: Nature Communicatio... |
bc143d30a156f79cb62bfc29b6007b7a8dcb5af6cd4deca8cc373251925cc8ca | MATLAB | 17,373 | 484 |
% Detect chambers from bg image.
%
% To detect chambers, use:
%
% [centers, r, w, h] = calib_chamber_detect(bg, n_chambers, [shape], [r], [w], [h])
%
% where [] denotes an optional parameter and:
%
% bg - bg structure, computed with calib_bg_estimate
% n_chambers - number of chambers to be detected
... |
5fe1eea27a7eb4eede5d11ac9e68d63a430265d17a67f1f289f5bf0697513896 | MATLAB | 17,388 | 434 | % getCorrelationEphysContParam_cond_fly.m
%
% Variant of getCorrelationEphysContParam_cond() that operates on one fly
% at a time and allows normalization of spike rate (as
% fraction of max spike rate (max as percentile) or as change from
% baseline (when fly isn't walking). Note that this also means that mean
% s... |
cfa0b06ba067ee22fda58f054451ebc3ceaf6817158c18db31b18fdb5af2681a | MATLAB | 17,391 | 305 | %% Neurofeedback: main ripple quantifications; timecourse
%
animals = {'remy','gus','bernard','fievel','jaq','roquefort','despereaux','montague'}; %,'gerald'};
epochfilter{1} = [' $ripthresh>=0 & (isequal($environment,''goal'') | isequal($environment,''hybrid2'') | isequal($environment,''hybrid3'')) '];
epochfilter{2... |
890b0662c70ebed1bf2aabe1987d3b8bfeafe911cf0eadd68fb21d0d02823d53 | MATLAB | 17,396 | 476 | function [GREPhase, GREMag,Params] = read_DICOM(DICOMdir, Params, verbose)
% function [GREPhase, GREMag,Params] = read_DICOM(DICOMdir, Params, verbose)
%
%% Author: Xu Li
%% EDITED BY JIRI VAN BERGEN - 2014
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
%
% read in DICOM format SWI images (Mag or Phas... |
fb498b850e02938639cd66022e9a18c391f95b02a527f25ec3826af9162584a9 | MATLAB | 17,426 | 433 | % getSlideWinEphysFwdAccYawVel_cond_fly.m
%
% Function to extract correlation between spike rate or median filtered
% membrane potential and forward acceleration and yaw velocity using
% sliding window for computing behavioral values at each time point
% Adaptation of getCorrelationEphysFwdAccYawVel_cond_fly()
%
% Us... |
c3e000728ff1080ae6ad07b9514b6e7e3dfee6d0db087d8f94674409d044f468 | MATLAB | 17,440 | 662 | % mglTaskLog.m
%
% $Id:$
% usage: mglTaskLog(myscreen)
% by: justin gardner
% date: 05/01/14
% purpose: Writes log of all experiments that have been done on computer
% Can also display the log:
% mglTaskLog;
%
% or display the log for a particular year:
... |
e6036ee41ff552351048900aba4f3eebd62c20a3efd72d86ae5fbbe0835c8dcc | MATLAB | 17,503 | 452 | function [type] = ft_senstype(input, desired)
% FT_SENSTYPE determines the type of acquisition device by looking at the
% channel names and comparing them with predefined lists.
%
% Use as
% [type] = ft_senstype(sens)
% [flag] = ft_senstype(sens, desired)
%
% The output type can be any of the following
% 'ctf64'... |
c1a72f81da52d6c56dbb54e990bf099855aea270d53262722abe2a30eb53c4ec | MATLAB | 17,524 | 432 | function [lh_labels, rh_labels] = CBIG_MSHBM_parcellation_single_subject(params)
% [lh_labels, rh_labels] = CBIG_MSHBM_parcellation_single_subject(params)
%
% This function is a simplified wrapper to perform MSHBM individual 17-network
% parcellation for a single subject. This function takes simple inputs (strings)
% a... |
722e02b9392e4b67cbdc7f9cf9a20cd4a13d6aa154c75687d3c95da844a18bb3 | MATLAB | 17,556 | 467 | % Automated injection workflow - Preparation step
% In this step, a crystal pipette ordinarily used in electrophysiology or virus injection is prepared.
% Because the pipette is hand-made and disposable, its length may vary, causing positioning errors.
% Therefore, a calibration step is essential to account for this... |
0103ddd51c8857a2c47cc9281973419ef93e9e407ff7692fe4cd68e4cae3de03 | MATLAB | 17,565 | 418 | clc
ManualMark_on=get(handles.cue_channel,'Value');
calmode=get(handles.calmode_pm,'Value');
switch calmode
case 1
modeindex='data405';
cal=passdata.data405;
case 2
modeindex='data470';
cal=passdata.data470;
case 3
modeindex='data580';
cal=passdata.data580;
en... |
9e3279baa1721236c29c3ddda61c9cdefbf6043aaafef861b0b05074a0934620 | MATLAB | 17,721 | 646 |
function my_net_run_batch(net_config, work_info_batch)
gen_data_info_groups_cache(net_config, work_info_batch);
group_idx=net_config.ref.root_group_idx;
data_info=init_one_data_info_from_cache(group_idx, work_info_batch);
input_info=work_info_batch.ref.ds_info.net_input_info;
data_info... |
278049f1f8bf1b461269eb61a6d4635270a0fefdcbe142316fe71987f6f19662 | MATLAB | 17,727 | 411 | function CBIG_MMLDA_visualize_factors(in_dir, out_dir, k, min_thresh, max_thresh, ...
mask, behavior_name, behavior_domain, mni_space)
% CBIG_MMLDA_visualize_factors(in_dir, out_dir, k, min_thresh, max_thresh, mask)
%
% This function will visualize atrophy maps and cognitive deficits of estimated factors.
% The at... |
e234c0b241811026e26829ad8581ffc33028b656e35997bc7f96f288e49b1463 | MATLAB | 17,758 | 406 | function [results, opt] = AOIStats(data, participant, opt)
% Return a table with a summary of the AOI statistics for every recorded
% task.
if isfield(data, 'parameters'), data = rmfield(data, 'parameters'); end
tasks = fieldnames(data);
for task_index = 1:length(tasks)
task = tasks{task_index};
... |
7605f9ebc41b618cbbae679c081a60c366ab346114da2ba0a4acf61cb90bc49e | MATLAB | 17,783 | 488 | % interactGetLegReversals.m
%
% Function for getting max and min in leg positions, when leg reverses
% direction
% Brings up GUI, 1 leg at a time, plotting leg X position, x's for computed
% min and max. Starts with sliders to adjust parameters. When user clicks
% button, changes to mode to select points to delete o... |
5ad83bcc1efbeefe0b6c9d6cd16311f443a5e467177e60b89df63a41cf9e4656 | MATLAB | 17,791 | 371 | function processEvents(obj)
%PROCESSEVENTS Summary of this function goes here
% Detailed explanation goes here
if obj.oldProcedure
fID = fopen(obj.eventsFilename, 'r');
%% Read ASCII-Events File - split all up in single lines
lines = textscan(fID, '%s', 'delimiter', '\t', 'EmptyV... |
3d93caf4a5935cb57374f22e70ac2bd7a8e292dcefcccec577fa9eeffa66553a | MATLAB | 17,813 | 361 | %% Automated
% Load all data
% Find available datasets (always using dates as folders)
clear DateOpt
DateOpt = arrayfun(@(X) dir(fullfile(DataDir{DataDir2Use(X)},MiceOpt{X},'*-*')),1:length(MiceOpt),'UniformOutput',0);
DateOpt = cellfun(@(X) X([X.isdir]),DateOpt,'UniformOutput',0);
DateOpt = cellfun(@(X) {X.name},DateO... |
f10deb1bc8bd2f88bfd60e0b4d608a37407194f26d5f42470befc188c9a28ffd | MATLAB | 17,875 | 517 | %
% Please cite this paper if you use any component of this software:
% S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast
% and robust active neuron segmentation in two-photon calcium imaging using
% spatio-temporal deep learning," Submitted to PNAS.
%
% Released under a GPL v2 license.
function ... |
3fa9a4ff6f650155f591042b386500fb84df8ab0649132b84cd5c1861168dd61 | MATLAB | 17,893 | 516 | function json=savejson(rootname,obj,varargin)
%
% json=savejson(rootname,obj,filename)
% or
% json=savejson(rootname,obj,opt)
% json=savejson(rootname,obj,'param1',value1,'param2',value2,...)
%
% convert a MATLAB object (cell, struct or array) into a JSON (JavaScript
% Object Notation) string
%
% author: Qianqian Fa... |
dc6e10f920e376cde4288f35d18cc026727f8e52ef2427ef6c2fd4cf06b5c8a3 | MATLAB | 17,898 | 528 | function[data,h]=SONGetADCChannel(fid, chan, varargin)
% SONGETADCCHANNEL reads an ADC (waveform) channel from a SON file.
%
% [DATA {, HEADER}]=SONGETADCCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}})
% FID is the matlab file handle, CHAN is the channel number (1=max)
%
% [DATA, HEADER]=SONGETADCCHANNEL(FID, 1{, ... |
1fbd9e2cf1196cee13c8df36b3daa6160cdadd2d9f90123f49eadca6bf312257 | MATLAB | 17,920 | 409 | % computeLegStepsFictracEphysIinj_1Fly.m
%
% Function that extracts the individual leg traces, FicTrac, and ephys in
% response to current injection of different durations and amplitudes for
% a single fly.
% User selects all pData for that fly through the file selection GUI
% Saves the data as a struct in path spe... |
7eb000250d1168948d2cabef3cb34f6f32c6439a1878e8126249dc98520445d3 | MATLAB | 17,957 | 548 | function cspm_lmgs(Pin,overwrite,prefix,display,GM)
% CSPM_LMGS - Detrend fMRI image series using LMGS method.
% CSPM_LMGS(P, OVERWRITE, PREFIX, DISPLAY, GRANDMEAN )
% P is array of images returned by spm, e.g. (SPM2):
% P = spm_get(Inf, '.img',{'Please select images for detrending'}... |
4a52c330737e3aed44a3c1dc845c4f44a43213ae7b05be537dab4f6947908de2 | MATLAB | 18,018 | 396 | function [Root, Group, Channels] = tdmsinfo(tdmsfilename)
% Read DAQmx raw data information.
% [Root, Group, Channels] = tdmsinfo_eppg(tdmsfilename)
%
% NOTE: this function can only be used in the TDMS file, which is acquired
% by PXIe-6368 DAQ card. I havn't any other card to try TDMS DAQmx raw
% data format. (O... |
17aa1c2b5580d758084aa3bf634e49776e44ec326cff8f900b537b57bb3497f2 | MATLAB | 18,035 | 462 | classdef packcyl < handle
% Packing cylinders
%
% Usage:
% pc = packcyl();
% pc.packing(maxdensity,hardwallBC,rinit,root,target,compileFlag,n,gap)
%
% Input:
% maxdensity: maximal cylindrical volume fraction
% hardwallBC: boundary condition, 0 for periodic, 1 for hard wall
% rin... |
220f23884354c0b5023d29195fe89b9b2b06592845da34f05795485707ee7e72 | MATLAB | 18,093 | 407 | % preprocess.m
%
% First function to run on ephys/FicTrac/leg video/current injection data.
%
% On ephys data:
% Converts raw voltage traces collected on the DAQ into named
% voltage/current signals with the appropriate units.
% If option is selected, finds spikes, returns spike times and spike rate.
% Also re... |
00bcdd588c85ac4bc733a909e11e2c063dc1853fe93c730769c7e70246e17526 | MATLAB | 18,168 | 443 | % function figure3(which_part, alpha_resp, alpha_nonresp,...
% all_or_one_or_non_resp_stimuli, which_responses, su_only, plot_visibility, ...
% narrow_ylims, seed, no_overlaps, resp_win, which_half)
function create_fig3_source_file(alpha_resp, plot_visibility, ...
narrow_ylims, seed, no_overlaps, which_half... |
f9aa74fe04b77700a62d6425aaf460be53bc6075e9dfd04aaf1598d7a5fb625f | MATLAB | 18,192 | 442 | function demoRSVP_simSeqPRF_varyConditions_mainExp(subject)
% Demo of 2 blocks of single experimental run of the
% simultaneous-sequential spatiotemporal pRF experiment
%
% INPUTS
% [subject] : (string) ID of subject (default to 'test')
%%% at the scanner:
% set trigger box to these options (per JG):
% change mo... |
f6899afabc718925f4b5ee133064d9faaf221b82f16774a392c812bd75129ad0 | MATLAB | 18,195 | 553 | function result = cvRpcr(x,y,kmax,rmsecv,h,k)
%CVRPCR calculates the robust RMSECV (root mean squared error of cross-validation) curve
% for RPCR or the robust RMSEP (root mean squared error of prediction) value in a fast way.
% The R-RMSECV curve can be used to make a selection of the optimal number of
% components... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.