Adaptive optical correction for in vivo two-photon fluorescence microscopy with neural fields

像素 计算机科学 计算机视觉 光学 人工智能 堆栈(抽象数据类型) 位图 算法 灰度 样品(材料) 显微镜 图像处理 图像质量 亚像素渲染 泽尼克多项式 显微镜 光圈(计算机存储器) 二进制数 数字图像相关 图像分辨率 人工神经网络 二值图像 薄层荧光显微镜 自适应光学 物理 光流 运动估计 迭代重建 运动场 职位(财务) 图像复原 光学显微镜 数学
作者
Iksung Kang,Hyeonggeon Kim,Ryan G. Natan,Qinrong Zhang,Stella X. Yu,Na Ji
标识
DOI:10.24433/co.2804276.v1
摘要

This repository contains the code for Neural fields for Adaptive Optical Two-photon Fluorescence Microscopy (NeAT). NeAT operates in three stages: 1. **Aberration and structural estimation** From a single 3D image stack, NeAT estimates system or sample aberrations and recovers the underlying structural information, without any external training data. 2. **Conjugation error correction** NeAT estimates and corrects conjugation errors in the imaging system, typically caused by incomplete conjugation or alignment errors. 3. **Sample motion correction** NeAT maintains performance even with sample motion during the acquisition of the 3D input stack, by adaptively registering and correcting slice-to-slice motion artifacts. --- ### Code overview This capsule includes three main scripts: #### `neat_learning.py` Core routine that takes a 3D image stack as input and outputs aberration and structural estimations. Key physical parameters can be set via command-line arguments (a full list of tunable options is in the `args` parser): - `psf_dx, psf_dy, psf_dz`: pixel sizes (µm) along $x$, $y$, $z$ axes - `cnts`: center coordinates of the input stack - `dims`: dimensions of the input stack - `na_exc`: excitation numerical aperture (NA) - `sample_motion`: Boolean parameter for sample motion correction. True if sample motion correction is performed. **Expected outputs:** - **`rec.h5`** — HDF5 file containing: - `out_x_m`: estimated structure - `out_k_m`: estimated PSF - `out_y`: computed image stack - `wf`: Zernike coefficients - `loss_list`: losses per epoch - `y`: normalized input stack - `y_min`, `y_max`: normalization bounds - **`est_aber_map.bmp`** — bitmap of the estimated aberration map from `wf` (unit: waves) - **`slm_pattern.bmp`** — 8-bit grayscale image (with a pixel value of 255 corresponding to 1 wave) that is the wrapped corrective phase pattern to be applied to an SLM for aberration correction, if needed. Feel free to explore the code and adjust parameters to suit your imaging setup. #### `neat_conj_est.py` This script estimates conjugation errors that may be present in a two-photon imaging system. It should be run after `neat_learning.py` on six image stacks. For testing, example stacks acquired using a microscope at UC Berkeley are available under `/commercial_beads_zeros/`, `/commercial_beads_mode4/`, `/commercial_beads_mode6/`, … and `/commercial_beads_mode13/`. Users should acquire these image stacks using their own system to estimate conjugation errors specific to their microscope. To acquire these stacks, users need to display on the SLM images corresponding to a flat phase pattern and five different Zernike modes for calibration (modes 4, 6, ..., 13), respectively. These patterns are available in `/slm_patterns_for_calibration/` as `k_vis_zeros.bmp`, `k_vis_mode4.bmp`, `k_vis_mode6.bmp`, ..., `k_vis_mode13.bmp.` (To apply these patterns directly on a SLM, the SLM needs to be calibrated so that a pixel value of 255 corresponds to 1 wave. The patterns can also be scaled and formatted for a deformable mirror.) Conjugation errors are computed as an affine transformation $\hat{H}$, from the reconstructions of these stacks and saved to `H.h5`. #### `neat_conj_corr.py` This script compensates for the conjugation errors estimated by `neat_conj_est.py` by applying the inverse affine transformation $\hat{H}^{-1}$ to an SLM pattern (generated as `slm_pattern.bmp` by `neat_learning.py`, which does not include conjugation error correction). The corrected pattern is saved as `k_vis_(args.dataset)_with_H.bmp`. > **Note:** If you are using a microscope with perfect conjugation and alignment, you can skip `neat_conj_est.py` and `neat_conj_corr.py`. --- ### Running the Capsule This capsule demonstrates NeAT’s application on both custom-built and commercial microscopes: 1. **Microscope with perfect conjugation and alignment** Run NeAT on a fixed mouse-brain-slice image stack (data in `/custom_built_brain_slice/`), where conjugation-error correction is not required. 2. **Calibration for a microscope with possible conjugation and alignment issues (e.g., most commercial systems)** Process five calibration stacks, estimate conjugation errors, and apply those corrections to generate an error-corrected SLM pattern. 3. **In vivo imaging with motion** Run NeAT on an in vivo mouse-brain image stack with sample motion. If the samples do not require motion correction (e.g., zebrafish larvaes or plants) but still need conjugation error correction, simply set `sample_motion = False` and proceed with this step.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
脑洞疼应助唉科研采纳,获得10
刚刚
上官若男应助小天才采纳,获得30
刚刚
2052639534发布了新的文献求助10
2秒前
nan完成签到,获得积分10
2秒前
Liam关注了科研通微信公众号
4秒前
5秒前
111完成签到,获得积分10
7秒前
7秒前
希望天下0贩的0应助mengxin采纳,获得10
8秒前
在水一方应助WENc采纳,获得10
8秒前
8秒前
Colleen完成签到,获得积分10
9秒前
尊敬的怡完成签到,获得积分10
10秒前
chen发布了新的文献求助10
10秒前
10秒前
科研通AI6.2应助高大语蕊采纳,获得10
11秒前
12秒前
李健的粉丝团团长应助smmy采纳,获得10
12秒前
唉科研发布了新的文献求助10
13秒前
14秒前
有人应助直率的火龙果采纳,获得10
15秒前
15秒前
cm完成签到,获得积分10
15秒前
忧郁半青发布了新的文献求助10
16秒前
yangfan_scs发布了新的文献求助10
18秒前
Liam发布了新的文献求助10
19秒前
小小发布了新的文献求助200
19秒前
天真的棒棒糖完成签到,获得积分10
19秒前
20秒前
达夫斯基发布了新的文献求助10
22秒前
23秒前
hbj发布了新的文献求助10
23秒前
SciGPT应助Murray采纳,获得10
24秒前
田様应助畅快蓝血采纳,获得10
24秒前
24秒前
彭于晏应助随机发采纳,获得30
27秒前
WWW完成签到,获得积分10
28秒前
29秒前
方子怡发布了新的文献求助10
29秒前
Will发布了新的文献求助10
29秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Developing Genetic Editing Tools for Lysobacter 2000
卤化钙钛矿人工突触的研究 2000
Моделирование процессов самоорганизации в кристаллообразующих системах 1000
History of U.S. Space Surveillance and Satellite Cataloging 1000
Adhesion Science: Principles & Practice 800
Signals, Systems, and Signal Processing 610
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6521429
求助须知:如何正确求助?哪些是违规求助? 8314681
关于积分的说明 17786454
捐赠科研通 5623717
什么是DOI,文献DOI怎么找? 2927682
邀请新用户注册赠送积分活动 1904426
关于科研通互助平台的介绍 1764603