# MesoLF — Mesoscale volumetric light-field imaging
The MesoLF hard- and software solution allows recording from thousands of neurons within volumes of ⌀4 × 0.2 mm, located at up to 350 µm depth in the mouse cortex, at 18 volumes per second and an effective voxel rate of ~40 megavoxels per second.
MesoLF was developed by the [Vaziri Lab](http://vaziria.com/) at [Rockefeller University](https://www.rockefeller.edu/), and is described and demonstrated in the following publication:
Nöbauer*, T., Zhang*, Y., Kim, H. & Vaziri, A.
[*Mesoscale volumetric light-field (MesoLF) imaging of neuroactivity across cortical areas at 18 Hz.*](https://www.nature.com/articles/s41592-023-01789-z)
Nature Methods 20(4) (2023). doi:10.1038/s41592-023-01789-z
Auxiliary data (trained models, PSF, demo data; see placement instructions in the Installation section below) is available on Zenodo: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7306113.svg)](https://doi.org/10.5281/zenodo.7306113)
Please submit any issues or questions to this repository's [issue tracker](https://github.com/vazirilab/mesolf/issues).
## System requirements
* Software:
* Matlab-compatible version of Windows or Linux (see https://www.mathworks.com/support/requirements/matlab-system-requirements.html)
* Matlab R2020a or newer
* Toolboxes: signal processing, image processing, statistics and machine learning, curve fitting, parallel computing
* Matlab-compatible CUDA driver (>= 10.1 for Matlab R2020a)
* Tested on Ubuntu Linux 20.04 with Matlab R2020a, CUDA driver v11, CUDA toolkit v10.1
* Hardware:
* Matlab system requirements (see https://www.mathworks.com/support/requirements/matlab-system-requirements.html)
* RAM should be about twice the size of the raw data in one patch. For data from 4-mm MesoLF optical system and 6 x 6 patches, ~128 GB RAM are recommended
* Matlab-compatible Nvidia GPU (see https://www.mathworks.com/help/parallel-computing/gpu-support-by-release.html], >~ 10 GB GPU-RAM recommended
* Tested on a workstation with two Intel Xeon Gold 6136 CPUs (12 cores each), 256 GB RAM, 4 TB NVMe flash disk, three Nvidia Titan V GPUs with 12 GB GPU-RAM each
## Installation
1. Add folder containing `mesolf.m` and all subfolders to Matlab path
2. Ensure Matlab's `mex` compiler is configured with a compatible compiler, as listed here: https://www.mathworks.com/support/requirements/supported-compilers.html
3. Change directory to subfolder `src/cuda` and run `build.m` to run the mexcuda compiler to build CUDA and C++/MEX binaries. This should result in a file `mex_lfm_convolution_vec.mexa64` (file extension may differ depending on platform)
4. [Download zip file](https://zenodo.org/record/7306113/files/mesolf_cnn_svm_models.zip?download=1) (1 GB) containing trained CNN and SVM models for calcium trace classification, and place the files contained in the zip file into folder `utility/`
5. [Download simulated point spread function file](https://zenodo.org/record/7306113/files/PSFmatrix_lfm2pram_M10_FN12p5_pm200_from-200_to200_zspacing4_Nnum15_lambda520_OSR3.mat?download=1) (.mat, 3.3 GB) and save it to an arbitrary directory, which we refer to below as `<psfdir>`. PSF files for optical systems other than MesoLF can be generated using the function `computePSF_GUI()` that was published as Supplementary Software with [Prevedel et al., Nature Methods (2014)](https://www.nature.com/articles/nmeth.2964#MOESM188).
Typical installation time: 5 minutes. Download times depend on connection speed; should be <1 hour on a reasonably fast connection
## Usage
* See comments in `src/mesolf_set_params.m` for documentation of required and optional arguments
* A complete demo is provided as a Matlab live script, `mesolf_demo.mlx`, which downloads a ~33 GB demo dataset (two patches of ~600 × 600 μm field of view each, 7-minute MesoLF recording at 18 fps from mouse cortex labelled with SomaGCaMP7f, depth range 0–200 μm), sets parameters, runs the full MesoLF pipeline and plots the results for inspection. The demo requires ~60 GB of RAM and took 18 minutes to run on a workstation with two Intel Xeon Gold 6136 3.00GHz CPUs with 12 cores each, 260 GB RAM, and a 1 TB NVMe SSD hard disk. One nVidia TITAN V GPU with 12 GB RAM was used.
* In general, to run the MesoLF pipeline, pass at least the required arguments to the main function, `mesolf()`. Arguments can be passed in two alternative ways:
1. As a single struct with fields named like the parameters defined in mesolf_set_params.m
2. As a series of key-value pairs, with keys matching the parameter names defined in mesolf_set_params.m
Example using the first option:
```
% Prepare parameter struct
myparams = struct;
% Required arguments
myparams.indir = '/disk1/dataset1_raw';
myparams.outdir = '/disk1/dataset1_mesolf';
myparams.psffile = '<psfdir>/PSFmatrix_lfm2pram_M10_FN12p5_from-100_to100_zspacing4_Nnum15_lambda520_OSR3.mat';
myparams.frames_x_offset = 1234.567;
myparams.frames_y_offset = 2345.678;
myparams.frames_dx = 15.123;
% Some optional arguments
myparams.frameRate = 18; % frame rate of raw data
myparams.n_patches = 6; % number of tiles per side to divide FOV into
myparams.patch_mode = 'carpet'; % tile FOV into a "carpet" of n_patches by n_patches tiles
myparams.filt_method = 'cnn'; % use pre-trained CNN for final trace classification
myparams.gpu_ids = [1 2]; % use GPUs 1 and 2
% Run MesoLF
mesolf(myparams)
```
* Parameters `frames_x_offset`, `frames_y_offset`, `frames_dx` (central microlens offets in x and y and microlens pitch, all in units of pixels) can be conveniently determined using the LFDisplay software published by the Levoy lab at Stanford University: http://graphics.stanford.edu/software/LFDisplay/
* Parameter `indir` should point to a folder containing a series of .tif files containing one frame of raw data each. Files will be read in in alphabetic order.
* Replace `<psfdir>` with the path to the directory containing the PSF file.
没有合适的资源?快使用搜索试试~ 我知道了~
中尺度体积光场(MesoLF)成像matlab代码.zip
共165个文件
m:150个
txt:4个
mat:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 91 浏览量
2024-03-25
23:53:22
上传
评论
收藏 5.81MB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
中尺度体积光场(MesoLF)成像matlab代码.zip (165个子文件)
dilateDisc.c 4KB
mex_lfm_convolution_vec.cu 17KB
LICENSE 1KB
edgedetectiongui.m 79KB
edgedetectiongui20040615.m 78KB
normcorre_batch.m 24KB
mesolf.m 19KB
gen_seed_library_local_with_ring_bg_same_size.m 17KB
greedyROI_endoscope_summary_shape_aware.m 16KB
applyCOSFIRE.m 15KB
neuron_segmentation_module_alter.m 15KB
recon_theory_phase_space_LFM_with_filter_simple_peeling.m 15KB
mesolf_set_params.m 14KB
apply_shifts.m 13KB
saveastiff.m 12KB
determine_patch_info_aug.m 12KB
iterator.m 12KB
patch_merging_module.m 12KB
hierarchical_clustering.m 11KB
dftregistration_min_max.m 11KB
recon_theory_phase_space_LFM_with_filter.m 11KB
fit_ellipse.m 9KB
conv2FFT.m 9KB
gen_seed_library_local.m 9KB
applyCOSFIRE_inhib.m 9KB
computeTuples.m 8KB
BCOSFIRE_lfm.m 7KB
summary_image_generation_module.m 7KB
loadtiff.m 7KB
update_spatial_lasso_with_bg.m 6KB
evalperformance.m 6KB
computeGaborEnergy.m 6KB
gen_seed_library_fast.m 5KB
configureCOSFIRE.m 5KB
calc_inhibfacil.m 5KB
image_load_module_aug.m 5KB
update_temporal_lasso_with_bg.m 5KB
component_merge.m 5KB
filterkernel_onscreen.m 5KB
mm_fun_lomem.m 5KB
Gabor.m 5KB
foopsi_oasisAR1.m 5KB
calcPowerspectrum.m 5KB
motion_correction.m 5KB
facilkernel_onscreen.m 5KB
inhibkernel_onscreen.m 5KB
gaborfilter.m 5KB
thinning.m 5KB
evalperformance20040615.m 5KB
thinning.old.m 4KB
showCOSFIREstructure.m 4KB
rdir.m 4KB
update_spatial_lasso_local.m 4KB
gaborkernel2d.m 4KB
running_percentile.m 4KB
colorful_label_3D_segments.m 4KB
local_bg_remove.m 4KB
oasisAR1.m 4KB
seed_library_generation_module.m 4KB
saveastiff_demo.m 4KB
SystemConfig.m 4KB
get_noise_fft_mod.m 4KB
temporal_activity_filtering.m 4KB
motion_metrics.m 4KB
update_temporal_lasso_local.m 3KB
update_spatial_lasso.m 3KB
hysthresh.m 3KB
plotActivityTrace.m 3KB
calc_phasessuppos.m 3KB
convolution.m 3KB
readandinit.m 3KB
main_demixing_module.m 3KB
mex_lfm_convolution_vec_test.m 3KB
filterkernelpower_onscreen.m 3KB
fakepad.m 3KB
createretinamaskcolored.m 2KB
gen_phasespace_PSF_theory.m 2KB
preprocess.m 2KB
update_temporal_lasso.m 2KB
filter_with_bloodvessel_mask.m 2KB
cell2mat_ov_sum.m 2KB
correct_bidirectional_offset.m 2KB
extract_a.m 2KB
neuropil_coefficient_estimation_greedy.m 2KB
blurshift.m 2KB
virtual_shift.m 2KB
library_refinement.m 2KB
LFM_reconstruction_module.m 2KB
textprogressbar.m 2KB
estimate_time_constant.m 2KB
calc_halfwaverect.m 2KB
hyperstack_write.m 2KB
calc_viewimage.m 2KB
preprocessRetina.m 2KB
remove_boundaries.m 2KB
HALS_temporal.m 2KB
facilitationkernel2d.m 2KB
LFM_registration_module.m 2KB
shift_reconstruct.m 2KB
component_refinement_module.m 2KB
共 165 条
- 1
- 2
资源评论
Matlab科研辅导帮
- 粉丝: 1w+
- 资源: 7491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功