Preparation of the modulation patterns
This part aims to produce the binary data to be preloaded into the DMD as modulation patterns. The file ‘DMD_hadamard256.m’ in this file folder is used to generate Hadamard-like patterns with orders up to 256 × 256. Hadamard-like patterns with different orders can be generated as well by adjusting the parameter ‘number’ in this file. The execution of this file with commercialized software MATLAB generates a sequence of Hadamard-like patterns in the format of .txt binary files. To minimize phase drifting caused by environmental disturbance during the experiment, the first order of Hadamard-like patterns (DC signal) is inserted after every 16 modulation patterns as the tracking base. Therefore, 73,728 patterns are generated in a sequence and it takes about 25 minutes to finish this one-time preparation. This MATLAB code is provided in ‘Supplementary Code’, which can be accessed in the public repository Zenodo [1].
A DMD (Texas Instrument DLP7000&DLPC410) is employed to project Hadamard-like patterns to the sample. The software and the control board of the DMD are provided by Vialux company (model number Vialux V7001). The Hadamard-like patterns in the format of .txt binary files can be uploaded to the random-access memory (RAM) in advance. Unfortunately, we do not provide a series of .txt files of Hadamard-like patterns for saving space as it occupies a large memory of about 50 Gbit (less than the 64 Gbit of the RAM of the DMD). After execution of this MATLAB file, the regenerated .txt binary files will be collected in the default document ‘data_image256_3_3_8bitplane_russia_persuitbasis2_txt’.
Data acquisition
This part describes how to collect the data. The main C++ code file that is implemented in the Visual Studio C++ project is included in the main folder named ‘joint_256bitplane8’, which is provided in ‘Supplementary Code’ that can be accessed in the public repository Zenodo [1].
This folder includes some necessary files of the Visual Studio C++ project to control both the DMD and the DAC. In this project, the execution of an integrated C++ source file named ‘joint_256bitplane8.cpp’ enables the DMD to display the desired Hadamard-like patterns with full speed and the DAC to acquire data subsequently. After preloading all the desired Hadamard-like patterns onto the DMD, it takes about 3 seconds to finish the data acquisition once. Please visit the website https://visualstudio.microsoft.com/zh-hans/ to download the Visual Studio 2019 community version.
However, the successful execution of these C++ files requires the correct configuration of environment variables in a “normal” desktop computer as well as the physical presence of the DMD and the DAC. It means that the data acquisition step cannot be run successfully without any supporting SDKs from Vialux and NI that manage the DMD and the DAC.
To gain control of the DMD and the DAC respectively, please visit the website https://www.vialux.de/en/download.html to download corresponding control files for the DMD and https://www.ni.com/zh-cn/support/downloads/drivers/download.ni-daqmx.html#288248 for the DAC.
Holographic reconstruction
This part illustrates how to use MATLAB to reconstruct holographic images from the experimentally measured data. In the file folder named ‘holographic reconstruction’ provided in ‘Supplementary Code’ that can be accessed in the public repository Zenodo [1], there are two subfolders named ‘stained tissue from mouse tails’ and ‘unstained tissue from mouse brains’, corresponding to different types of biological tissue. In each folder, the MATLAB file named ‘singlepixel_dataprocessing_complex.m’ is the main file executed for holographic reconstruction. After executing the main file and loading the converted MATLAB data named ‘biological_sample.mat’ and ‘background_curvature.mat’, output files including many intermediate variables are stored in the folder named ‘results’. Among them, the expected amplitude and phase images are named ‘imaging-amplitude.fig’ and ‘imaging-phase.fig’, respectively.
A flowchart of the step-by-step procedures to reconstruct holographic images is shown in Fig. 1.