Open Source

We are always happy to share source code or data from papers and projects, as long as appropriate credit/citation is given for any use of our work and it is not being used for commercial purposes. Email Laura (waller @ berkeley [dot] edu) for Matlab code requests from specific papers, or see below for some open source datasets and codes. If you use this code/data, we’d love to hear about what you do with it!


Please see the Waller Lab Github Page for our latest open-source software and hardware.



CalOptrics GPU toolbox:

CalOptrics is an open source fast and easy-to-use C++ library for CUDA-based GPU computing of basic functions used in computational optical imaging. It uses an array-based function set which makes programming with CUDA easier than programming raw CUDA code. Underneath the hood, CalOptrics is powered by the Thrust, Cusp, and other CUDA open source libraries and designed using Object-oriented and abstraction techniques like interfaces to make modifications to raw lower-level implementations simple and quick. The design also makes it easy to implement a non-CUDA version like OpenCL to be used in this library.

Please cite as: D. Ramalingam, L. Waller, CalOptrics Open Source, UC Berkeley (2014).


Phase from defocus GUI:

This Matlab based phase recovery GUI provides a platform for implementing various TIE-based methods and iterative phase retrieval on a stack of through-focus intensity images. Input stack can be a 3D Matlab matrix (*.mat) or a sequence of  tiff images (registration GUI included). Defocus steps need not be linearly spaced. The user can choose between standard TIE, higher order TIE [1], iterative TIE [2], Gaussian Process TIE [3] or the Gerchberg-Saxton iterative method for large defocus distances (see Fienup 1982).

Please cite as: G. Gunjala, L. Waller, Open Source PhaseGUI, UC Berkeley (2014)
[1] L. Waller, L. Tian, G. Barbastathis, Optics Express 18(12), 12552-12561 (2010).
[2] A. Shanker, L. Tian, M. Sczyrba, B. Connolly, A. Neureuther, L. Waller, Applied Optics (2014).
[3] Z. Jingshan, R. Claus, J Dauwels, L. Tian, L. Waller, Optics Express 22(9), 10661-10674 (2014).

Light field refocusing and 3D differential phase contrast on LED array microscope:

Matlab code implements the popular ‘shift-and-add’ light field digital refocusing algorithm. The code is designed for processing data captured by sequentially turning on an array of illumination angles on our LED array microscope. It then splits the data based on illumination angles according to the differential phase contrast (DPC) method to compute the phase gradient information of the sample. The same algorithms can be also used for lenslet-based light field microscope.

Please cite as:
L. Tian, J. Wang, L. Waller, 3D differential phase contrast microscopy with computational illumination using an LED array, Opt. Lett. 9, 1326 – 1329 (2014).

Quantitative DPC phase imaging with LED array:

Matlab code implements a Tikhonov deconvolution based phase reconstruction algorithm from single or multi-axis DPC data. Images should be captured with LED array illumination using two complementary halves of the brightfield circle on in each image. The transfer functions are calculated according to the Weak Object Transfer Function and solve for phase in the least squares sense. The complementary images are subtracted and DPC images contain the phase gradient information.

Please cite as:
L. Tian, L. Waller, Quantitative differential phase contrast imaging in an LED array microscope, Opt. Express 23, 11394-11403 (2015).

Fourier ptychography reconstruction algorithm with quasi-Newton second-order optimization

Matlab code implements Fourier ptychography reconstruction algorithm from a set of images captured under different illumination angles (e.g. in an LED array microscope), using either sequential or multiplexed coded illumination. The algorithm simultaneously estimates the complex object function (amplitude + phase) withhigh resolution (defined by objective NA+illumination NA) and the pupil function (aberrations). It implements a sequential quasi-Newton’s method with Tikhonov (L2) regularization.

Please cite as:

L. Tian, X. Li, K. Ramchandran, and L. Waller, “Multiplexed coded illumination for Fourier Ptychography with an LED array microscope,” Biomedical Optics Express 5, 2376-2389 (2014).

DiffuserCam reconstruction algorithm

Matlab code implements the alternating direction method of multipliers (ADMM) reconstruction algorithm for recovering images from diffuser-based lensless cameras. The algorithm solves an iterative least-squares problem to recover either 2D pictures or 3D data cubes from DiffuserCam raw data. Sample DiffuserCam data is provided.


Please cite as:

Nick Antipa, Grace Kuo, Reinhard Heckel, Ben Mildenhall, Emrah Bostan, Ren Ng, and Laura Waller, “DiffuserCam: lensless single-exposure 3D imaging,” Optica 5, 1-9 (2018)



Phase from defocus Cheek cell dataset:

This 68.2 MB image dataset contains a stack of 129 through-focus images from a Nikon TE300 microscope, captured with a piezo axial motion stage (Thorlabs PZ). Experimental parameters are listed in a separate text file included in the zip file download. The sample is unstained cheek cells from Jingshan Zhong’s mouth, placed on a microscope slide and sealed with a coverslide. This represents nearly a pure phase object, though there are some small specks of amplitude variation.

Please cite as: Z. Jingshan, R. Claus, J Dauwels, L. Tian, L. Waller, Optics Express 22(9), 10661-10674 (2014).

LED array Fourier Ptychography dataset:

This dataset (may take a long time to download!) contains images from 293 different LED illumination angles up to NA=0.5, captured with a 4x 0.1 NA objective. Fourier Ptychography thus enables ~0.6 NA (our reconstruction is here). We use an Adafruit LED array placed ~6cm above the sample on a Nikon TE300 inverted microscope (more experimental parameters in text file). The sample is a dog stomach cardiac region histology sample.

Please cite as: L. Tian, X. Li, K. Ramchandran, L. Waller, Biomedical Optics Express 5(7), 2376-2389 (2014).

L. Tian, Z. Liu, L. Yeh, M. Chen, Z. Jingshan, L. Waller, Optica 2(10), 904-911 (2015).

More datasets:


3D Fourier Ptychography datasets:

Images from sequential LED illumination up to 0.41 NA, using a 4x objective (0.1 NA). We achieved resolution corresponding to NA~0.5 with a multiple scattering multislice model that combines 3D light field refocusing with FPM to achieve super resolution in both lateral (x,y) and axial (z) dimensions.

Please cite as: L. Tian, L. Waller, 3D intensity and phase imaging from light field measurements in an LED array microscope, Optica 2, 104-111 (2015).

More datasets:



LED Dome

These files contain everything you need to assemble a 508 LED Dome attachment for a CellScope device. Computational CellScope is a smartphone-based microscope which uses a programmable LED array to enable multi-contrast imaging and digital refocusing in a portable package. We have included the components of the mechanical and electrical CAD designs necessary to construct and control the domed illuminator, as well as the smartphone application. This repository may be updated with corrections or additions, but old versions will still be available. Licensed under the CC-BY Open Source License.


Please cite as:

cDPC Filter

These files contain the CAD models and processing code necessary for performing single-shot quantitative phase imaging on a Nikon TE300 brightfield microscope. Our method, cDPC, requires just one hardware modification — an inexpensive 3D printed condenser insert which uses PET color filters. cDPC is a single-shot variant of Differential Phase Contrast (DPC), which recovers the phase of a sample from images with asymmetric illumination. We employ partially coherent illumination to achieve resolution corresponding to 2× the objective NA. Quantitative phase can then be used to synthesize DIC and phase contrast images or extract shape and density. We demonstrate amplitude and phase recovery at camera-limited frame rates (50 fps) for various in vitro cell samples and c. elegans in a micro-fluidic channel.


Please cite as: