遇见数据集

Dataset and code for multi-peak bragg ptychography simulations

收藏
Zenodo2024-03-05 更新2026-05-26 收录
官方服务:

资源简介:

Simulation code and dataset for multi-peak bragg ptychography reconstruction. Paper titled: Imaging extended single crystal lattice distortion fields with multi-peak Bragg ptychography Paper accepted for publication in Optics Express (TBD). Preprint at:https://arxiv.org/abs/2312.14907 The preprint currently contains an older version of the paper and the paper figuers, from before revision. However, the algorithms and the gist of the paper remains unchanged. The workflow used for the simulations and reconstructions was as follows: 1) Take 2D probe structure collected in an experiment at NSLS. This is stored at: `mbptycho/experiments/matlab/datasets_0821/recon_probe_29902.mat` 2) Specify the Bragg peaks of interest and some basic simulation parameters to the matlab code in `mbptycho/experiments/matlab/code_0821` to generate the interpolated 3D probe structure for the individual Bragg peaks. The version of the probes used in the paper is stored in `mbptycho/experiments/matlab/datasets_0821/probes.h5' 3) Use these simulation parameters and the probe structures for python (numpy and scipy) based forward simulations to generate the simulated diffraction data. 4) Use the simulation parameters and simulated data for Tensorflow-based reconstruction code. There is a lot of redundancy in this workflow. Ideally, we would not need either the matlab or the numpy/scipy code and rely exclusively on Tensorflow code. After all, the Tensorflow code also contains the forward simulations. We were not able to curate and clean the workflow and code due to time constraints. Structure: mbptycho/mbptycho: Contains the python code used for the forward model simulation and reconstructions. mbptycho/mbptycho/code: The python files in this base directory are for the forward model only. This part uses numpy and scipy extensively. mbptycho/mbptycho/code/recons: The code here uses Tensorflow 2.x for GPU-based reverse-mode automatic differentiation for the forwrad model and reconstruction. This code is tightly coupled with the numpy-based forward model code in mbptycho/mbptycho/code for parameters like the object and probe sizes, pixellations, ptychography scan locations, etc. This needs to be decouped before use in actual experiments. mbptycho/mbptycho/tests/point_inclusions_sparse_scan/weak_peaks: This part contains the jupyter notebooks with actual simulation, reconstruction, and the resulting figures. The directory structure indicates that we are simulating a sparse ptychographic grid scanning a thin film with point inclusions, generating diffraction peaks with low photon counts. sim.ipynb: Contains the forward mode simulation. The simulated thin film and the collected diffraction data are stored separately as lz4 files as described below. recons_*.ipynb: Contain the reconstruction code with the notation as used in the paper preprint. The reconstruction outputs are saved variously as npz and gz files as described below. plots.ipynb:Plotting the results for publication. mbptycho/experiments: Contains the matlab code used to generate the 3D probe structure, the matlab outputs. Also contains the simulation and reconstruction results obtained from the python code. experiments/matlab:Contains a draft version of the simulation code written in matlab. Also contains the data generated from the matlab code. Note that the 3D probe structure generated from the matlab code are used in the python simulations (just to avoid rewriting and testing the probe interpolation code). experiments/matlab/code_0821Contains the matlab codes (in *.m files) that: take the 2D probe structure (as mentioned above) and generates interpolated 3D probe structures for the various Bragg peaks. A draft version of the forward simulation. experimetns/matlab/datasets_0821Contains the 2D probe structure file, the 3D probe structures (in probes.h5 for the latest version) and some temporary ".mat" files used in the matlab simulations. mbptycho/experiments/python/point_inclusion_sparse/weak_peaks : Contains the files lz4 files generated during the initial forward simulation with numpy/scipy. Also contains the npz and gz files generated during the Tensorflow-based reconstructions.

本数据集包含用于多峰布拉格叠层成像(multi-peak Bragg ptychography)重建的仿真代码与实验数据。相关研究论文题为: 《Imaging extended single crystal lattice distortion fields with multi-peak Bragg ptychography》(中文译题:利用多峰布拉格叠层成像对扩展单晶晶格畸变场进行成像) 该论文已被《Optics Express》录用(待正式出版,TBD),预印本链接:https://arxiv.org/abs/2312.14907 当前预印本包含修订前的旧版论文内容与图表,但论文的核心算法与主旨未发生变化。 本研究用于仿真与重建的工作流程如下: 1) 采用美国国家同步光源(NSLS)实验中采集的二维探针结构,其存储路径为: `mbptycho/experiments/matlab/datasets_0821/recon_probe_29902.mat` 2) 针对`mbptycho/experiments/matlab/code_0821`路径下的Matlab代码,指定目标布拉格峰与基础仿真参数,以生成各布拉格峰对应的插值三维探针结构。论文中使用的探针版本存储于: `mbptycho/experiments/matlab/datasets_0821/probes.h5` 3) 基于上述仿真参数与探针结构,使用Python(依赖numpy与scipy库)进行正向仿真,生成模拟衍射数据。 4) 结合仿真参数与模拟数据,运行基于TensorFlow的重建代码。 该工作流程存在大量冗余环节。理想情况下,无需使用Matlab或numpy/scipy代码,仅依赖TensorFlow代码即可完成全部流程——毕竟TensorFlow代码本身已集成正向仿真功能。但受限于时间约束,我们未能对该工作流程与代码进行整理与精简。 ### 项目目录结构 1. `mbptycho/mbptycho`:存放用于正向模型(forward model)仿真与重建的Python代码。 - `mbptycho/mbptycho/code`:该根目录下的Python文件仅用于正向模型,大量依赖numpy与scipy库。 - `mbptycho/mbptycho/code/recons`:此处代码基于TensorFlow 2.x,针对正向模型实现基于GPU的反向自动微分(reverse-mode automatic differentiation)重建。该代码与`mbptycho/mbptycho/code`下基于numpy的正向模型代码存在强耦合,例如共享目标与探针尺寸、像素化参数、叠层成像(ptychography)扫描位置等配置。该部分需先解耦后方可在实际实验中使用。 - `mbptycho/mbptycho/tests/point_inclusions_sparse_scan/weak_peaks`:该目录包含实际用于仿真、重建及结果绘图的Jupyter笔记本。该目录对应的仿真场景为:采用稀疏叠层扫描网格对含点状夹杂的薄膜进行扫描,生成低光子计数的衍射峰。 - `sim.ipynb`:包含正向仿真代码,模拟的薄膜与采集的衍射数据将分别存储为lz4格式文件(详见下文说明)。 - `recons_*.ipynb`:包含对应预印本论文中所用符号体系的重建代码,重建结果将以npz与gz等格式存储(详见下文说明)。 - `plots.ipynb`:用于生成可用于发表的结果绘图。 2. `mbptycho/experiments`:存放用于生成三维探针结构的Matlab代码、Matlab输出结果,以及Python代码生成的仿真与重建结果。 - `experiments/matlab`:包含Matlab编写的仿真代码草稿,以及Matlab代码生成的数据集。需注意:Matlab代码生成的三维探针结构会被Python仿真所复用(以避免重复编写与测试探针插值代码)。 - `experimetns/matlab/code_0821`:存放以下Matlab代码(*.m文件): - 读取前述二维探针结构,并为各布拉格峰生成插值三维探针结构; - 正向仿真的草稿版本。 - `experimetns/matlab/datasets_0821`:存放二维探针结构文件、三维探针结构(最新版本存储于`probes.h5`),以及Matlab仿真中使用的部分临时.mat文件。 - `mbptycho/experiments/python/point_inclusion_sparse/weak_peaks`:存放通过numpy/scipy进行初始正向仿真时生成的lz4格式文件,以及基于TensorFlow的重建过程中生成的npz与gz格式文件。

提供机构:
Zenodo
创建时间:
2024-03-05
二维码
社区交流群
二维码
科研交流群
商业服务