sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
8669a6c93da0fcb11ef94e3131534db410b86935486ff56bc5562c9d9d3d2d6f
MATLAB
3,176
151
%% Load this function in Cell Mode and read the code for example usage clear %Fit a noisy measurement with a spline x = (0:.5:10)'; y = sin(x*pi*.41-.9)+randn(size(x))*.2; %Triple knots at the end knots = [0,0,0,0:10,10,10,10]; %Least squares fit for the weights of a spline s = fastBSpline.lsqspline(knots,3,x,y); clf...
ff607c35d6ece50a0bbc0b43f5eb151f80425d55ecef637362b7350c192621b0
MATLAB
3,183
83
classdef selectRoisGui < handle properties % The GUI is associated with an acq2p object, and specifically one % slice in that object: acq = Acquisition2P.empty; slice = 1; % Structure for all handles: h = struct('fig', [], 'ax', [], 'img', [], 'ui', [], 'time...
9e6662ae7497a8a4b7e357b94010cd6f09bc38d0076580dca678857c03f6fd83
MATLAB
3,200
58
%% Variable declaration %%%%%%%%%%%%%%% FOV and PATTERN parameters %%%%%%%%%%%%%%% Grid.pxsize = 10; % Pixel size in nm (scalar) Grid.pxnum = 1280; % Pixel count on axis (integer) Pattern.shape = {"microtubules","microtubules"}; %"mithocondria","mithocondria" "microtubules","microtubules" Pattern shape: ci...
9773858d2fc1282e4ed95bd1a41aed56900fb00cfbf33fc7bf239ce633079703
MATLAB
3,206
108
function playMov(mov) % playMov(mov) displays a H-by-W-by-nFrames array as a movie, similar to % ImageJ. Clicking any spot in the image jumps to the frame at which the % clicked point is brightest. % % To do: % - Implement play button % - align activity trace to slider. mov = downsampleWithAvg(mov, 10); % Display fi...
cb34ff35a5f871680c57e82af78e4863ef2f9196628a816e085721f775f67453
MATLAB
3,274
58
%% Variable declaration %%%%%%%%%%%%%%% FOV and PATTERN parameters %%%%%%%%%%%%%%% Grid.pxsize = 10; % Pixel size in nm (scalar) Grid.pxnum = 1280; % Pixel count on axis (integer) Pattern.num = 50; Pattern.shape = {"DNAorigami"}; %"mithocondria","mithocondria" "microtubules","microtubules" Pattern shape: ci...
4e0da1e9022a35f5c596cc5bc66fe144c6b150e52b7f977a66a76a2929975bc2
MATLAB
3,291
91
%% csf mobility all subjects %% purpose % 1) plot average of ADC as it moves from 0 % 2) plot average of FA as it moves from 0 % 3) violinplot of ADC average as steps % 4) violintplot of FA average as steps % 5) statistical comparison clear; % Define project parameters project_directory = '/exports/gorter-hpc/users...
99830b548e02b643dcb8b895ecae0397dd92d5fa0f95b204820d3075c9c98517
MATLAB
3,331
95
%% csf mobility all subjects %% purpose % 1) plot average of ADC as it moves from 0 for different cross sectionals % 2) bar plots for ratings % 3) statistical comparison clear; % Define project parameters project_directory = '/exports/gorter-hpc/users/ninafultz/'; project_name = 'csfdonuts_lydiane'; fig = 'donut02...
fd0fde9ccbefda19a0a6ee439bf47ad1d120853f2e3663f4ea562bf1ac61c12c
MATLAB
3,337
80
function plotNeuropilTraces(sel, bodyInd, neuropilInd, isIndInNhCoords) if ~exist('isIndInNhCoords','var') || isempty(isIndInNhCoords) isIndInNhCoords = true; end %Load cell body and neuropil fluorescence mov = sel.movMap.Data.mov; if isIndInNhCoords %if currently in neighborhood coord movIndBody = sel.nh2mov...
674897c9e468eda3c8ba450bba95fad405c2bb05f905a9dcf10b056742139b6b
MATLAB
3,417
63
%% function, third party function from sofi-tool function photons=brightness(Ion,Ton,Toff,Tbl,frames) %Simulate the intensity trace of an emitter (photons per frame). % %Inputs: % Ion maximum signal per emitter per frame [photons] % Ton average duration of the on-state [frames] % Toff average du...
613c27e255484c4668472bc7ee9543b800e1d00ef524212c26640d0faa2def27
MATLAB
3,454
99
function calcPxCovBin(obj, movNums, radiusPxCov, temporalBin, sliceNum, channelNum, writeDir) % calcPxCov(obj, movNums, radiusPxCov, temporalBin, sliceNum, channelNum, % writeDir) Function to calculate all pixel-pixel covariances within a % square neighborhood around each pixel. Size of the neighborhood is % radiusPxCo...
1497ed319420b2bc7f1438cf6949f1e8b579c23f93213c08c8cc5286a8d72319
MATLAB
3,475
107
%% calculating eigenpairs (λ1e1, λ2e2, λ2e2) (will give all principal diffusivity and orientation) % nina fultz nov 27th, 2025 clear close all GENERALDIR = 'R:\- Gorter\CSF_STREAM\Data\'; newFolder = 'R:\- Gorter\- Personal folders\Fultz, N\csfdonuts_lydiane\'; physioFolder = '\Cardiac\T2prep'; subject = dir...
eedc39ff74db124ebb59acfb881f8b0d348073b5907a4eb0cc34217dcedafa1a
MATLAB
3,609
98
function plotDonutBarPlots(filename, col_right, col_left, categories) %% % Read the Excel file data = readtable(filename, 'FileType', 'spreadsheet'); % Reads .xlsx file % Initialize counts for each category category_counts = zeros(1, length(categories)); % Store category data for statistical te...
e872c39ffda90d24cfb16cb6d72b564dadb9dd8878fc22e37e91edb4cc9299f2
MATLAB
3,630
106
function [traces, rawF, roi, traceNeuropil] = ... extractROIsBinWithEdgeSubtraction(obj,roiGroups,sliceNum,channelNum) % Function for extracting ROIs from movies using grouping assigned by % selectROIs. This function uses a memorymapped binary file of the entire % movie, as output by indexMovie. See extractROIsTIFF...
9c39ea336c4286d269333cd35a2b2c2f56b6878edc46ca5807a307bc1b537a25
MATLAB
3,722
122
%% CAMERA CALIBRATION % This script evaluates the offset and gain maps of a digital camera % according to the procedure reported in [1]. Other useful information for % an accurate gain calibration can be found in [2]. % % Please, be aware that some sCMOS cameras have two gain regimes (low and % high intensity), i...
8a30f24b6ec6dd19af81f6a3eb544ae706d222ea79cf4cac780cfb93aef12a71
MATLAB
3,802
88
function newDir(obj,destDir,doCor,doInd,doCov,doNMF) %Copies an acquisition and the associated motion corrected files from %the original location to a new one, and creates a new acquisition %object associated with the new location. % %newDir(obj,destDir,doCor,doInd,doCov) %destDir is the directory to which files will b...
d87786828139cf7974a0c33030dc521a93fa2f793275e68849a8318bf6016ccd
MATLAB
3,804
102
function t1s_to_niftis(subjPath); % goal: convert adc and fa maps to niftis % register t2 maps to the b0 %% Paths regDir = fullfile(subjPath, 'reg'); anatFolder = fullfile(subjPath, 'anat'); % anat folder path % Target file path echo1File = fullfile(regDir, '*_properOrientation.nii'); % Check if the ...
02d6ea7b2d883ce0fb5cf78a3fd0a765399dcd521ffbe1f24a228741d30cf8f3
MATLAB
3,805
115
%% WRITEXMLREC Write a Philips XMLREC image file pair % % [SUCCESS] = WRITEXMLREC(FILENAME,DATA,INFO) % % FILENAME is a string containing a file prefix or name of the XML header % file or REC data file, e.g. SURVEY_1 or SURVEY_1.XML or SURVEY_1.REC % % DATA is an N-dimensional array holding the image d...
d50ad6982bff4fe704aaf14c86056e080918d4f10de8658923c43285e1504d3a
MATLAB
3,828
103
function T2maps_to_niftis(subjPath); % goal: convert adc and fa maps to niftis % register t2 maps to the b0 %% Paths t2maps_path = fullfile(subjPath, 't2_maps'); regDir = fullfile(subjPath, 'reg'); fa = fullfile(subjPath, 'fa'); adc = fullfile(subjPath, 'adc'); anatFolder = ful...
1baf4a3421835521a18d19ff5f3cf2a9c3d4d997d6da82403b0c4ced95bc243d
MATLAB
3,831
99
function adcValues = plotADCandB0Values(project_directory, project_name, subject_list, roi_patterns, voxel_size) %% Load Subject Data subject_code = subject_list(1).name; subjPath = fullfile(project_directory, project_name, subject_code); ROIs_dir = fullfile(subjPath, 'ROIs'); reoriented_dir = fullf...
68bed0d6c821b367def3c387721c57e5a5799e8bf6cd2a29e8e99bb58375f71b
MATLAB
3,864
119
function plottingADCandFAacrossPhasesAllSubjectsACA(physio, signal, physio_bin, roi_pvsas, ... nPhases, phasesLoaded, roiName, subject_code); cardiac = phasesLoaded; %% Extract mean ADC or FA over phases for each ROI if strcmp(signal, 'FA') ymax = 1; ymin = 0; else ymax = 0.055; ymin = 0; end...
313e5f86c1251e0abadaf74cc8068096bb9047dc62b90b1cb2ebe5eea886a2e3
MATLAB
3,884
109
% The light version of the SWI matlab tool, without GUI. % script SWI_Duyn_ParRec % to do SWI and unwrapping retrospectively on PARREC data % default is kernel = 92 and SWI = 4 % please contact Emiel in case of problems clc; clearvars; %% data info % nrFiles = 1; source_location = "R:\Emiel\PRIDE\pride_duyn\...
5946a972987d1f9599672a9bb471e555cf9f23c5bfda48cf511e2c71e22d56a2
MATLAB
3,960
140
function [Id,dpx,dpy, B] = doLucasKanade(T,I,dpx,dpy) % Parts of the Lucas Kanade motion correction code were obtained from % https://xcorr.net/2014/08/02/non-rigid-deformation-for-calcium-imaging-frame-alignment/ % and/or are originally based on the method published in: % Greenberg, David S., and Jason N.D. Kerr. “A...
2975bf0c0579d8ee163568e2664497b35b5bf948a3b72b11f4b12ce5883787cd
MATLAB
3,997
133
function plottingADCandFAacrossPhases(physio, signal, physio_bin, roi_pvsas, ... roi_sas, nPhases, phasesLoaded) cardiac = phasesLoaded; %% Extract mean ADC over phases for each ROI extract_roi_means = @(data, roi) cellfun(@(d) mean(d.data(roi)), data); card_pvsas = extract_roi_means(cardiac, roi_pvsas);...
2ba064454116eecd5f78cd5058275292aa6ae63d131a796dfabccc719b2b6937
MATLAB
4,032
111
function acq = mjlmInitialization(acqId, rawFileLocation, acqName) % acq = mjlmInitialization(acqId, rawFileLocation, acqName) % % acqId (formerly fileId) is some fragment of the file name of the current % acquisition that is unique to the current acquisition. % % rawFileLocation is where the tiff files are located. Th...
a1bfeb7f8297c2229d7196f78a76937e2a64e31e5f17531f9fc977a25f6069a3
MATLAB
4,121
95
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Help file for acq2pJobProcessor class. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % INTRODUCTION: % % acq2pJobProcessor (aka ajp) is a tool for automatic processing (motion % correction, binary movie file and...
25752f59435636e77a2ba889547f78d992c7dbea9004a55b7ddd728463fceada
MATLAB
4,155
117
%%% Peak Sorted Heatmaps: Spikes & Vm with SEM Shading %%% Aanchal Bhatia clear all; close all; clc; load('D:\Recordings\Figures\paperLists\controlCells.mat') % --- CONFIGURATION --- SHIFT_BINS = 45; SMOOTH_WIN = 5; spkSort = []; spkPlot = []; vmPlot = []; cellCounter = 0; for i = 1:length(control...
c47a148ecd012439f5ef62e4c8a02ecbd21f39bf97de7104ccf16badc23fcfde
MATLAB
4,235
130
%% plotting Concentric Circles lydianes way % csf donut protocol for CAA patients % nina fultz january 2026 % n.e.fultz@lumc.nl %% goals: clear clc %% % defining paths project_directory = 'R:\- Gorter\- Personal folders\Fultz, N\'; project_name = 'csfdonuts_lydiane' scripts = fullfile(proj...
330049ed9d4994d9160ee9225a3d3c63db7a74461ebab2627081c450d062a7ac
MATLAB
4,266
111
function calcPxCov(obj, movNums, radiusPxCov, temporalBin, sliceNum, channelNum, writeDir) % calcPxCov(obj, movNums, radiusPxCov, temporalBin, sliceNum, channelNum, % writeDir) Function to calculate all pixel-pixel covariances within a % square neighborhood around each pixel. Size of the neighborhood is % radiusPxCov p...
56cc303aee8e175712e89031ef06ac934eff2de40ca2002514485f3796f4a1af
MATLAB
4,271
120
function plotDonutInvidualSubjects(project_directory, project_name, subject_list, roi_patterns, voxel_size); roi_data = struct(); for roi_name = roi_patterns roi_data.(roi_name{1}).ADC = {}; % Cell array for variable-length ADC data roi_data.(roi_name{1}).FA = {}; % Cell array for variable-length FA data en...
ccf87cf83756d114250b603f4366edf00f89617382a3c5662889fd65cf324a83
MATLAB
4,285
123
function updateOverviewDisplay(sel, redrawAllRois) %Helper function that updates the reference image with current ROI labels if ~exist('redrawAllRois', 'var') || isempty(redrawAllRois) redrawAllRois = true; end % % Redraw image if slider is used: % if isfield(sel.h.ui,'sliderBlack') % Slider is not implemented in...
be717ef8ccb6afd46d6818e6264f26780f3958c613ef071da3eb041fa541be1b
MATLAB
4,335
118
% Clear everything to ensure an empty environment before running clear all close all clc % Load the Calcium Model's data load('Sim_TS_Less_Tunnelling.mat') %% Specify the mesh points to track the calcium concentration in the model % The tracking points can be changed by referring to the generated mesh in % the Geom_...
62a6842f2229b288d1b9384a241b5ad04af49e902f4e5f6a6f87f9cccbfb8415
MATLAB
4,359
107
clear; GENERALDIR = 'R:\- Gorter\CSF_STREAM\Data\'; newFolder = 'R:\- Gorter\- Personal folders\Fultz, N\csfdonuts_lydiane\'; physioFolder = '\Cardiac\T2prep'; physio = 'cardiac'; threshold = 75; allSubjects = dir([GENERALDIR '*20201014_Reconstruction']); for s = 1:numel(allSubjects) subject = allS...
166587219e7706f70ec7f42c4d9630d048197baa9100ceb53d0d64ff655f283f
MATLAB
4,406
99
%% This is an example script for creating a training set for RESURF (or any other AI method) % In this script, user defines the range of different input parameters % Settings/BaseSettings_MISRGRU.m includes other default parameters (basesettings_path) % Inputs: % seed: seed for the random generator % mainpath: fol...
16e21260aa55287ce2aaae19ce88230d7fd42bc80f81f11626f1c3dbc70b1f9c
MATLAB
4,434
117
function [gt_convolved] = gtGen_v2(emitter_dist, GroundT, Param, savepath, folname, plotfig, useGPU) % Function that convolves the emitter distribution and apply the necessary % down/upscaling to create ground truth noise free data % downsamples the fine-grid to match the image in camera plane and % upsamples to match...
90c5145c5bf59c4a1419dfa7201f4d0478824b5782bc810501f23a2754e2c4e0
MATLAB
4,466
141
function t2star_venogram(project_directory, project_name, subject_code); %t2star_venogram % Define the switch block for subject-specific operations switch subject_code case 'csfdonut01' subject_code = ''; common_prefix = 'T2star_3D_0.6_lowPNS'; case 'test' ...
8992216521e21944d15c824691a582baeb659d947e72753c6284c415f12e15e0
MATLAB
4,480
115
function [gt_convolved] = gtGen_v4(emitter_dist, GroundT, Param, savepath, folname, plotfig, useGPU) % Function that convolves the emitter distribution and apply the necessary % downscales the fine-grid to create ground truth by matching the FWHM and % pixel size of the GT % creates a GT folder including tiff files wi...
e9d1e69bb1374138dfe0528e95076954101073b582537dda181ca5ccec865801
MATLAB
4,503
101
%% This is an example script for creating a training set for RESURF (or any other AI method) % In this script, user defines the range of different input parameters % Settings/BaseSettings_MISRGRU.m includes other default parameters (basesettings_path) % Inputs: % seed: seed for the random generator % mainpath: fol...
d2bd8c524b25cdebda8d58cd4357a94a2df35f8f389e3f1f74dc5fa45258f72c
MATLAB
4,631
302
%% %model normal learning %plot auditory vs. spatial weight load model_chem_control.mat rmsd_all=[]; for qq=10 load mod2lp_control_result parm_results2=parm_results; parm_results2(:,2:4)=parm_results2(:,2:4)/10e7; qq=parm_results(qq,1); param=parm_results(qq,2:5); ...
d68ac94136a4d92de84efb4e6c51592e9fedf8bf3184841ef75e5eab5b15b959
MATLAB
4,640
110
function calcSeedCovBin(obj,radiusPxCov,seedBin,temporalBin,sliceNum,channelNum,writeDir) %Function to calculate sparse pixel-pixel covariances at an array of seed %points distributed throughout an image. % % calcSeedCov(obj,movNums,radiusPxCov,seedBin,temporalBin,sliceNum,channelNum,writeDir) % % radiusPxCov - radius...
5d70a260df874688ac6e2323dc4053b24a906822b2a340162be6a2eff4d733e5
MATLAB
4,670
144
function plotADCandB0Values(project_directory, project_name, subject_list, roi_patterns, voxel_size) %% % Process the first subject only subject_code = subject_list(1).name; subjPath = fullfile(project_directory, project_name, subject_code); ROIs_dir = fullfile(subjPath, 'ROIs'); reoriented_dir = f...
63e990bfe0fd02f65a47cf9f5e9bc2ff3c02f349adfaf03caaf22fbc020a7c3c
MATLAB
4,773
157
function plotADCandB0Values(project_directory, project_name, subject_list, roi_patterns, voxel_size) %% % Process the first subject only subject_code = subject_list(1).name; subjPath = fullfile(project_directory, project_name, subject_code); ROIs_dir = fullfile(subjPath, 'ROIs'); reoriented_dir = f...
f794db81d593151b03ddfb32b54543ba2f2c0cb7a6ba617aab7b5964a1dcd9ae
MATLAB
4,793
126
% Clear everything to ensure an empty environment before running clear all close all clc % Load the Calcium Model's data load('Sim_TS_Tunnelling.mat') %% Specify the mesh points to track the calcium concentration in the model % The tracking points can be changed by referring to the generated mesh in % the Geom_Mesh ...
06c1c7dd4ac2e4e20d81fcc1600996b0e9ea1ad2123d3f6826c32a8ef5910750
MATLAB
4,799
126
% Clear everything to ensure an empty environment before running clear all close all clc % Load the Calcium Model's data load('Sim_TS_No_Tunnelling.mat') %% Specify the mesh points to track the calcium concentration in the model % The tracking points can be changed by referring to the generated mesh in % the Geom_Me...
b8b61961a7a2fd25be918fe7cdeb6c24898928523c3def64ad2619fa2222ad16
MATLAB
4,815
247
%% %Evaluate Model A--use cum all perf -independent 2 loops, with random noise %plot fit performance load mod2lp_control_result parm_results2=parm_results; parm_results2(:,2:4)=parm_results2(:,2:4)/10e7; rmsd_all=[]; for qq=1:size(parm_results,1) qq=parm_results(qq,1); param=parm_results(qq,2:...
1d83f4aecf534c2b2ee88f5096ddaac8f444f646b6940b0b99bbed3675455f88
MATLAB
4,864
103
function fcMagnitude = computeNetworkMagnitude(fc_square, net_ids, subjects, task_type, align_type, curr_parc) % computeNetworkMagnitude Per-subject FC "strength" (magnitude) for each network combination. % % RECONSTRUCTED FILE — the original was missing from the release. Please % review against your archived outp...
94336b52bf6fa61a282e6ae35a24617184b106e92a476c9f467bcfa1ea175a94
MATLAB
4,867
149
function [trialData, trl] = ft_GenTrialData(dsname, varargin) % ft_GenTrialData % Trial definition + preprocessing for MEG data recorded on CTF systems (.ds). % Uses FieldTrip to define trials based on an event label, % then applies optional baseline correction, line-noise DFT filtering, and % band-pass filtering. % % ...
7ab4b99283ba50e5e300be81bc1b427c46120d9b9068869b8d0431f4409485e6
MATLAB
4,876
126
function plotDonutMeans(project_directory, project_name, subject_list, roi_patterns, voxel_size); roi_data = struct(); for roi_name = roi_patterns roi_data.(roi_name{1}).ADC = {}; % Cell array for variable-length ADC data roi_data.(roi_name{1}).FA = {}; % Cell array for variable-length FA data end num_rois =...
a41dfae78766ab9121a3bfc931a09d03620e15a8a0d1fb768bd53d938e46eb8b
MATLAB
4,876
140
function [cleanedData, artLog] = ft_CleanTrials(data, varargin) % ft_CleanTrials % Deterministic, batch-friendly trial rejection for MEG/EEG raw data. % Rejects trials based on: % 1) absolute amplitude (max |x|) % 2) robust z-score (max |(x-median)/MAD|) % 3) temporal gradient (max |diff(x)|) % 4) presence of N...
1f5b342f6bf8d2d7b0d996fe9cf92dffc0c3772fbec24206a479030da19542bf
MATLAB
4,935
140
function [cleanedData, artLog] = ft_CleanTrials(data, varargin) % ft_CleanTrials % Deterministic, batch-friendly trial rejection for MEG/EEG raw data. % Rejects trials based on: % 1) absolute amplitude (max |x|) % 2) robust z-score (max |(x-median)/MAD|) % 3) temporal gradient (max |diff(x)|) % 4) presence of N...
62efd01c3b22f37269dddfc656889e3575d731be5183c799cba5cc3b981828a2
MATLAB
4,935
148
function cbMouseclick(sel, objClick, ~, row, col) %Allows selecting a seed location around which to perform clustering %and select ROIs persistent initialClusterNum % Ignore if right click if ~strcmp(get(objClick, 'SelectionType'), 'normal') %if right click return end % Get current click location if nargin < 4 ...
ab7d3b0cfacc4eacce96330557ec855859f1effc8f34798897be802f83551de6
MATLAB
4,943
149
function plotADCandB0Valuesv5(project_directory, project_name, subject_list, roi_patterns, voxel_size) %% % Process the first subject only subject_code = subject_list(1).name; subjPath = fullfile(project_directory, project_name, subject_code); ROIs_dir = fullfile(subjPath, 'ROIs'); reoriented_dir =...
c7ff3d2a1120102e643590224fa215e436cece9884247c645dc9393f330725db
MATLAB
4,958
117
function [isc_herit, isc_herit_perm,isc_herit_jack] = runISCHeritability(curr_parc, base_dir, kinship, Subjects,alignType,dataType,isc_mz_id,isc_dz_id,isc_nz_id,scan_id,covari_motion,num_perm,fam_ids) % --- USER CONFIGURATION (edit these for your own system) --- desktop_dir = '/path/to/desktop'; % originally /Users/d...
55f2699a7c1b44bd974a87074c581003ec07f7d1c73fb073a4213e2319af3d52
MATLAB
4,973
163
function am2PInit(obj,movPath) %Example of an Acq2P Initialization Function. Allows user selection of %movies to form acquisition, sorts alphabetically, assigns an acquisition %name and default directory, and assigns the object to a workspace variable %named after the acquisition name if nargin < 2 || isempty(movPath...
4cdd5112e96777ea74359e54e1fb6feb310b2ebb37b868e005f3d61553676b98
MATLAB
4,999
140
function [blink_clean, Param] = ... blinkPSF(Grid, Cam, Fluo, Optic, Params, plotfig, saveParam) % Function that adds blinking to existing emitter locations and convolves % with GT PSF % % Inputs: % Grid struct % pxsize scalar, size of pixels [nm] % pxnum integer, amount of pixels on...
37ac751230797c1ed9b284b1094fe58e4a245c8472afc5b56a76888849e6d961
MATLAB
5,065
157
%% Running the rating analysis and plotting figures %#ok<*HIST> % Loading the clean and concatenated data load("Data\Ratings.mat") meana = mean(startlingness_all, 'omitnan'); % average startlingness rating for each sound meane = mean(valence_all, 'omitnan'); % average valence rating for each sound meanr = mean...
5c6f46c38b5b75dea8f0278d34331ad87fc9949c8c71b31c9f65819148695dd9
MATLAB
5,091
121
% Clear everything to ensure an empty environment before running clear all close all clc % Load the Calcium Model's data load('Sim_TS_Tunnelling.mat') % Specify the simulation time step used plot_time = zeros(num_t+1,1); plot_time(1) = 0; plot_time(2:num_t+1) = time; % Write the video destination and file name for ...
62614de6358d018708cd3da126288588b9219ffc391293f1d13e51656096472b
MATLAB
5,148
145
function createAcquisitionObjects(folder,forceOverwrite) %createAcquisitionObjects.m Looks through folder and creates acquisition %objects to be processed % %INPUTS %folder - folder to look through % %ASM 11/14 if nargin < 2 || isempty(forceOverwrite) forceOverwrite = false; end if nargin < 1 || isempty(folder) ...
404758469f9f9a7774cb2394252c66cc316be926633775b4d0eca0fc412a1cea
MATLAB
5,150
151
function indexMovie(obj, nSlice, nChannel, writeDir) %Function for creating a single large binary file containing an entire %movie for a given slice/channel, allowing rapid, indexed access to pixel %values. Needed to view ROI traces online within selectROIs GUI. % %indexMovie(obj,nSlice,nChannel,writeDir) % %writeDir i...
33b574a5422d7c144222270d13eab84243b03b044cdfd9716f0c336b593161f2
MATLAB
5,154
144
% csf donut protocol for CAA patients % nina fultz january 2026 % n.e.fultz@lumc.nl %% goals: % output: in your CCDir you are going to get a nifti called: 'vesseltoCheck_ALL.nii' % you will have to manually change that vessel mask, and then also split it % into M1, M2, and ACA sections. % name these files: '...
83e1a875c6c41644ac334fbd158d1eaa1e66b894e698bb564b078059871e7dde
MATLAB
5,236
152
function adc_and_fa_masking_reorientating(subjPath, subject_code, ADC_map_avg, FA_map_avg); % goal: convert adc and fa maps to niftis, create frangi filter on inverted % image % register t2 maps to the b0 %% Paths regDir = fullfile(subjPath, 'reg'); fa = fullfile(subjPath, 'fa'); adc =...
309241dac6b5773e6c0909f4e6e14ec83fad9a16aa0346f87a5f3175ab7b6e9b
MATLAB
5,267
129
function cbKeypress(sel, ~, evt) %Allows interactive selection / manipulation of ROIs. Possibly keypresses: % 'tab' - Cycles through selection of each cluster in seed region as current ROI. % 'f' - loads fluorescence trace for currently selected ROI, can be iteratively called to display multiple traces within single se...
e121b30f732068ee867a82832a3bd1199adb7b62c79bc021c92a57322e3eaece
MATLAB
5,337
157
function plottingADCandFAacrossPhasesAllSubjects(physio, signal, physio_bin, roi_pvsas, ... roi_sas, nPhases, phasesLoaded, roiName, subject_code); cardiac = phasesLoaded; %% Extract mean ADC or FA over phases for each ROI if strcmp(signal, 'FA') ymax = 1; ymin = 0; else ymax = 0.055; ymin = 0;...
a76c9076759ca65eab8d33c8a85d83064d755e3ed79cbf3cd6aca4732f5f7fb3
MATLAB
5,453
155
function [ADC_map_avg, FA_map_avg] = ADCandFAmaps_to_niftis(subjPath, subject_code); % goal: convert adc and fa maps to niftis % register t2 maps to the b0 %% Paths regDir = fullfile(subjPath, 'reg'); fa = fullfile(subjPath, 'fa'); adc = fullfile(subjPath, 'adc'); anatFolder = ful...
763bad367c55e1278ea0581fc1a684de76054d5dea309dadf11de9d7e5f1fa3d
MATLAB
5,525
145
function motionCorrect(obj,writeDir,movieOrder,motionCorrectionFunction,namingFunction) %Wrapper function managing motion correction of an acquisition object % %motionCorrect(obj,writeDir,motionCorrectionFunction,namingFunction) % %writeDir is an optional argument specifying location to write motion % corrected data ...
ecc2b6ad7579aaa49af7a31b8db135a8759442344d574aa7bba7e8fead8d10f4
MATLAB
5,556
194
% csf donut protocol for CAA patients % nina fultz january 2026 % n.e.fultz@lumc.nl %% output: mask of vasculature tree clear clc %% % defining paths project_directory = 'R:\- Gorter\- Personal folders\Fultz, N\'; project_name = 'csfdonuts_lydiane' scripts = fullfile(project_directory, '...
2f1c55f1b4c5bd5f0cc1ff37aec77589f872f6c4a91584f59a60e4051e20123c
MATLAB
5,659
263
%% %Simulate multiple CNO effect levels load mod2lp_control_result load model_chem_control.mat parm_results2=parm_results; parm_results2(:,2:4)=parm_results2(:,2:4)/10e7; % figure; % hold on; figure hold on; for cnoeffect=[0.75 0.5 0.25]; % cnoeffect=0.56; perfday=zeros(39,5,2); for qq=1:size(p...
7997edc71876ac6327ef1cff56df98320f8c7deb16a6d498c549d54c1ea9d8cf
MATLAB
5,712
170
function [trialData, trl] = ft_GenTrialData(dsname, varargin) % ft_GenTrialData % Trial definition + preprocessing for MEG data recorded on CTF systems (.ds). % Uses FieldTrip to define trials based on an event label (e.g., EMG2/EMG3), % then applies optional baseline correction, line-noise DFT filtering, and % band-pa...
1d1a95d57b9adecad6f26b5d37a6d57eb70844f8723ef9864a26dc30791989ba
MATLAB
5,828
216
function [upperEnv,lowerEnv] = envelope(x, n, method) %ENVELOPE Envelope detector. % [YUPPER,YLOWER] = ENVELOPE(X) returns the upper and lower envelopes of % the input sequence, X, using the magnitude of its analytic signal. % % The function initially removes the mean of X and restores it after % computing t...
3f85b2565c5047a0082b5c5b3e6d162e752ab53c8cfb68ee5ca0acaa2c4dfda9
MATLAB
5,851
397
function [img info] = metaImageRead(info, varargin) %METAIMAGEREAD Read an image in MetaImage format % % IMG = metaImageRead(INFO) % Read the image IMG from data given in structure INFO. INFO is typically % returned by the metaImageInfo function. % % IMG = metaImageRead(FILENAME) % Rea...
5d293c4d0c9320e1174e4ed22f531992e2d78fbf8cb932a505ef31b52bd36b73
MATLAB
5,869
191
function plotADCandB0Values(project_directory, project_name, subject_list, roi_patterns, voxel_size, adc_map); %% % Inputs: % project_directory % project_name % subject_list % roi_patterns % voxel_size % adc_map %% % Process the first subject only subject_code = subject_list(1).name; subjPath = fullfile...
23f5e3fa789ae24673ba31b4ffee68f54aac2788c287ba6c3a42b3f72451f871
MATLAB
5,963
141
%% This is function to simulate multiple experiments with a same underlying pattern and blinking % Only the noise and background level will change. The image sequence with % the highest SNR will include 1000 frames to reconstruct common SOFI target and the rest will have 20 frames % It will save the videos in 'Noisy' ...
0ee72928e34301327f201b09883f255e84bb29ed17e38bc0d37fe5cb506b0bd2
MATLAB
6,024
192
clear; clc; %% plot to show csf mobility ring around vessel and then SAS - M1 and M2 % Define paths project_directory = '/exports/gorter-hpc/users/ninafultz/'; project_name = 'csfdonuts_lydiane'; scripts = fullfile(project_directory, 'scripts'); addpath(genpath(fullfile(scripts, 'Violinplot-Matlab-master'))); addpat...
3fcf930c18f4dda37dfcb97e45c449e2c5de27d12f5de42380a7f1d9289006b3
MATLAB
6,091
164
function plotDonutFAMeansB0Meanplotted(project_directory, project_name, subject_list, roi_patterns, voxel_size); roi_data = struct(); for roi_name = roi_patterns roi_data.(roi_name{1}).ADC = {}; % Cell array for variable-length ADC data roi_data.(roi_name{1}).B0 = {}; % Cell array for variable-length FA data ...
52243ff68a199e5ceaaf2912adbfd5fe3736e1e3c1cb479111ee8dc718135488
MATLAB
6,101
164
function plotDonutMeansB0Meanplotted(project_directory, project_name, subject_list, roi_patterns, voxel_size); roi_data = struct(); for roi_name = roi_patterns roi_data.(roi_name{1}).ADC = {}; % Cell array for variable-length ADC data roi_data.(roi_name{1}).B0 = {}; % Cell array for variable-length FA data en...
033c2901e2c0b571026a5fe8a5a44020ad39dbb800b6201bf999a37f51976a5c
MATLAB
6,116
128
classdef Acquisition2P < handle %Class definition file for Acquisition2P class %Includes constructer methods, and functions for reading raw (readRaw) or %corrected (readCor) tiff's associated with acquisition % %obj = Acquisition2P; %obj = Acquisition2P('acqName'); %Acquisition2P('acqName',@...
17d05e083c1b9bdafa29bbdbfa595e3338dcd1d7d48e07df86e251c892a593f7
MATLAB
6,124
131
function [gt_convolved] = gtGen_movie(emitter_dist, GroundT, Param, savepath, folname, plotfig, useGPU) % Function that convolves the emitter distribution and apply the necessary % down/upscaling to create ground truth noise free data % downsamples the fine-grid to match the image in camera plane and % upsamples to ma...
a26eac50dbf9eee7617d8d8b5148a18fc3390394e03efcc6260b486208ea995f
MATLAB
6,141
217
function getBaseline_ransac_demo(sel) % Load cell body and neuropil fluorescence mov = sel.movMap.Data.mov; fBodyRaw = mean(mov(:, sel.acq.mat2binInd(sel.nh2movInd(sel.disp.indBody))), 2)'; fNpRaw = mean(mov(:, sel.acq.mat2binInd(sel.nh2movInd(sel.disp.indNeuropil))), 2)'; f = fBodyRaw - fNpRaw*sel.disp.neuropilCoef(2...
e83c9a3198713cbc61a0c75b62b73fae4c295677c13eb711a2172f1fe2ca6e38
MATLAB
6,160
204
function plotADCandB0Values(project_directory, project_name, subject_list, roi_patterns, voxel_size, adc_map); %% % Inputs: % project_directory % project_name % subject_list % roi_patterns % voxel_size % adc_map %% % Process the first subject only subject_code = subject_list(1).name; subjPath = fullfile...
4067c907c9d5bc9633613ff50809f16e6872c5f20cf5c0c8bcf6bf84d03e916d
MATLAB
6,164
203
clear; clc; %% plot to show csf mobility ring around vessel and then SAS - M1 and M2 % Define paths project_directory = '/exports/gorter-hpc/users/ninafultz/'; project_name = 'csfdonuts_lydiane'; scripts = fullfile(project_directory, 'scripts'); addpath(genpath(fullfile(scripts, 'Violinplot-Matlab-master'))); addpath...
58587767483dc2d8d5d2098857906e59a61128bf211ab511808c7558aab862da
MATLAB
6,224
165
function plotDonutMeansB0plotted(project_directory, project_name, subject_list, roi_patterns, voxel_size); roi_data = struct(); for roi_name = roi_patterns roi_data.(roi_name{1}).ADC = {}; % Cell array for variable-length ADC data roi_data.(roi_name{1}).B0 = {}; % Cell array for variable-length FA data end n...
5f95ca07bead821e8e30a77ec639e0022099269ead0e8bb0b231dfa4f4523666
MATLAB
6,261
173
function modifyAdapterFromCSV(adapterFile, csvFile) % MODIFYADAPTERFROMCSV - Modify adapter parameters using a CSV file % % Usage: % modifyAdapterFromCSV('myProjectNameAdapter.m', 'adapter_params.csv') % % CSV Format: % Parameter,Value,Type,Description % sigma,0.7,numeric,A...
5d14d20c891e71672dc1544de219263358551d109f5f6bd0e8762998e4ddd914
MATLAB
6,267
191
% From the paper of DBlink, a microtubules generator that is based on the % physical model of the paper: Shariff A, Murphy RF, Rohde GK. % A generative model of microtubule distributions, and indirect % estimation of its parameters from fluorescence microscopy images. % Cytometry A. 2010; 77(5): 457 - 66. % % TU Del...
a5753f83fd5e5f9bb793cf123066a5fc5aace42ebdf4c79f3eae49f1d56d8d65
MATLAB
6,291
174
%% MAIN PROTOCOL FOR ECOMODEL CONSTRUCTION AND ANALYSIS % This function performs a complete pipeline for constructing and analyzing % an enzyme-constrained metabolic model (ecModel) using GECKO. % % Parameters (all optional via name-value pairs): % project_name: Name of the project directory (string) % input_folde...
c79ce7a32d2a64e198e55118eb97a9d22ec0488302fc8baabf3c2a7cc6dc2e44
MATLAB
6,344
162
%% Mesh Generation for the No Tunnelling Calcium Model with 2 Subdomains (Cytoplasm and ER) % This is the code that generates the mesh of the Calcium Model (with % interior boundary). This mesh generation code follows MATLAB's % PDE Modeler User Guide. % Clear everything to ensure an empty environment before running ...
f40c2c6aac3d09e990c4dc502362c7a560e0716a14b4daf1b36cf6c962e912b5
MATLAB
6,383
131
function [ADC,FA,VectorF,DifT,Y]=DTI(DTIdata,parameters) % This function will perform DTI calculations on a certain % DTI dataset. % % [ADC,FA,VectorF,DifT]=DTI(DTIdata,parameters) % % DTIdata: A struct containing DTIdata(i).VoxelData, DTIdata(i).Gradient % and DTIdata(i).Bvalue of all the DTI dataset...
6454768f5d56010b90d2822ae7d5ce48cdc9d0d923129830f90c20bf8365017f
MATLAB
6,409
183
% csf donut protocol for CAA patients % nina fultz january 2026 % n.e.fultz@lumc.nl %% goals: clear clc %% % defining paths project_directory = 'R:\- Gorter\- Personal folders\Fultz, N\'; project_name = 'csfdonuts_lydiane' scripts = fullfile(project_directory, 'scripts', project_name); %...
5632476bd2a5be90fe3deae73a01d05de4ad1baf552c6e391c0d6e6ee5b96338
MATLAB
6,424
201
function processCurrentAcq(ajp) % Performs all processing of currently loaded acquisition. %create cleanup obj cleanupObj = onCleanup(@() moveBackToUnproc(ajp)); if ajp.debug ajp.log('Skipping all processing because debug mode is on.'); return end % Ensure that default dir exists: if ~exist(ajp.currentAcq.de...
5157ffd7e12ffaa3561d4dc9bffcd1986b44135916532283ce9c8c2405b677e1
MATLAB
6,591
155
%% plotting Concentric Circles lydianes way % csf donut protocol for CAA patients % nina fultz january 2026 % n.e.fultz@lumc.nl %% goals: clear clc %% % defining paths project_directory = 'R:\- Gorter\- Personal folders\Fultz, N\'; project_name = 'csfdonuts_lydiane'; scripts = fullfile(project...
a3908054e3af3a59b546118d656d3abb9abce65b6b5cbb76eedbef36f1b73c4b
MATLAB
6,629
134
function [VectorF1,VectorF2,VectorF3]=DTI_eigenpairs(DTIdata,parameters) % This function will perform DTI calculations on a certain % DTI dataset. % it is going to extract lambda 1, 2, and 3 % % [ADC,FA,VectorF,DifT]=DTI(DTIdata,parameters) % % DTIdata: A struct containing DTIdata(i).VoxelData, DTIdata(i).Grad...
ab2bda012166a70319fc3b91a19a8273cc94deb0a9319f9c86240d6688ee5856
MATLAB
6,663
166
%% Mesh Generation for the Calcium Tunnelling Model with 2 Subdomains (Cytoplasm and ER) % This is the code that generates the mesh of the Calcium Model (with % interior boundary). This mesh generation code follows MATLAB's % PDE Modeler User Guide. % Clear everything to ensure an empty environment before running cle...
2619a6d2c9fe9c395f52ee05fe050101b8aea2466aa0307669eb12c7cc97d0a3
MATLAB
6,687
155
%% Script 2: Unification Analysis and Significance Group Bar Charts clear all; close all; % --- 1. Load Clean Table Data --- dataPath = 'PredictPlateaus\PlateauPrediction.mat'; if exist(dataPath, 'file') load(dataPath, 'glmTable'); analysisTable = glmTable; else error('Run Script 1 first to creat...
bb8bbf404ff267b4f463905fecbd10ecca621c9c698bcd072e0a51f5594ec1a4
MATLAB
6,764
221
% csf donut protocol for t2 and csf mobility mapping % nina fultz december 2024 % n.e.fultz@lumc.nl clear clc %% goals: %% % defining paths project_directory = '/exports/gorter-hpc/users/ninafultz/' project_name = 'csfdonuts_lydiane' subject_code = '20191029_Rec' scripts = fullfile(project_dire...
fea2e1d0d51ed1bb33acabe579f485ae490950e84480c3ed7c6e112af8ace296
MATLAB
6,790
173
clear close all clc GENERALDIR = '/exports/gorter-hpc/users/ninafultz/csf_donut/'; allSubjects = dir('/exports/gorter-hpc/users/ninafultz/csf_donut/csf*'); workingFolder = '/csf_donut/'; savingdir = '/reoriented/'; anatScanLoc = '/anat/'; anatScanLabel = '3dT1_0.9mm.nii'; templateLocation = '/exports/gorter-hpc/users/...
1ad5d7caf9f28ead7308019918aeab5bbac0fd978e3f4409eba2ff86b21960ef
MATLAB
6,830
191
function [all_counts, short_counts, long_counts, all_plateau_times, short_plateau_times, long_plateau_times, dwell_times] = processEventsAroundAnchorDistance(... anchor_starts, distance, reset, event_starts, event_durations, bin_size_m, ... short_thresh_samples, speed, speed_threshold) % Initialize parameters...
76fd45ed9c786f5a0784194cfacdab1eb83331e17f80b08915de3d520c62fb51
MATLAB
6,964
157
clear all close all FolderNameSt=uigetdir('','Y:\pressure_EMG_optogenetic'); FolderOffset=2; listing1=dir(FolderNameSt); if isempty(FolderNameSt) return end n=1; nn=1; gap=2; for folder_cnt=1:length(listing1)-FolderOffset if listing1(folder_cnt+FolderOffset,1).isdir FileName_0=list...
30610d861c8fb2dfca3655f0cfbd88b2d1f4dff0caeb56a68113201c210d9b59
MATLAB
7,047
198
name={'1'}; cc_peak_mouse=[];cc_all=[];cc_all_rand=[]; for mouseNum=1:size(name,2) data1 = xlsread([name{mouseNum} '.xlsx'],1); % data2 = xlsread('data1.xlsx',2); %%% testdata1=cell(1,size(data1,2)); for i=1:size(data1,2) ind=~isnan(data1(:,i)); testdata1{i}=data1(ind,i); ...
314cb210acf7f9264633fa62ff83ce1d8254f9c606d5c9cc390561c5b050b12b
MATLAB
7,083
172
%% Mesh Generation for the Less Tunnelling Calcium Model with 2 Subdomains (Cytoplasm and ER) % This is the code that generates the mesh of the Calcium Model (with % interior boundary). This mesh generation code follows MATLAB's % PDE Modeler User Guide. % Clear everything to ensure an empty environment before running...
70ddb34f0e8fe292dcc7143da7a81de245c5b5c33ba6a48acbc9eecb58931de3
MATLAB
7,170
288
function metaImageWrite(img, fileName, varargin) %METAIMAGEWRITE Write header and data files of an image in MetaImage format % % metaImageWrite(IMG, FILENAME); % IMG is a matlab array, and FILENAME is the generic name (without % extension) of the metaimage file. % The functions tries to determine which...
59e395d866e5469e36653cdc006a3c693e29b72beb4a2b3184a229ad51bfd934
MATLAB
7,218
201
function run_all_steps(varargin) % run_all_steps % Minimal runner for the MEG ROI-connectivity pipeline (FieldTrip-based). % Runs (per subject): preprocessing/trials -> ROI time series -> wPLI+PSI % Then (group): group means and optional CBPT. % % IMPORTANT % - Keep only ONE FieldTrip on the MATLAB path (no addpath(gen...
43b2ca522a1b1408743f49cb1ca5b85cd4674ae0845c6ff924449da4c24fa45a
MATLAB
7,251
193
%% defining paths project_directory = 'R:\- Gorter\- Personal folders\Fultz, N\'; project_name = 'csfdonuts_lydiane'; scripts = fullfile(project_directory, 'scripts', project_name); %% params binWidth = 0.45; addpath(genpath(fullfile(scripts, 'csfdonuts_lydiane'))); addpath(genpath(fullfile(scri...