POVRay Bug
Biophysical Imaging & Spectroscopy


The software on this page will eventually be a collection of useful odds and ends that have been developed in the lab. The routines have been written for LabVIEW, and to run them you will need both LabVIEW v8.6 (or higher) and its IMAQ (image acquisition) components. This code is distributed under the terms of the GNU General Public License.

Digital Holography (see below for updates)

This code allows you to numerically refocus a microscope image and extract coordinates of a feature in the reconstructed volume. The numerical refocusing part is based on the Rayleigh-Sommerfeld IDL code from David Grier's group at NYU; they maintain a great collection of holographic microscopy tools there. For details of their method including published references, see their website.

Our code takes a stack of images and applies a filter that highlights weak scatterers. This filter exploits a phenomenon in classical optics called the Gouy phase anomaly. When a converging spherical wave passes through geometrical focus, it experiences a phase shift when compared to a plane wave of the same wavelength, moving in the same direction. The upshot of this is that in a microscope weak scatterers, also called phase objects, appear light on one side of the focal plane and dark on the other. When they lie in the focal plane, they're essentially invisible. We see this contrast inversion around the focal plane in our reconstructed stacks, and it's what lets us identify the axial position of small scatterers or scattering elements. We discuss this effect in more detail in our July 2012 Optics Express paper (open access).

The link below leads to a zipped version of the code including example image files and a POV-Ray scene file.

Click this link for zipped code, images and scene file (600kb)

The LabVIEW routine then extracts the coordinates that lie within the object of interest and exports them either as a 'bare coordinates' list, with format (intensity,x,y,z), or as a scene file for POV-Ray. The latter is a fantastic piece of free raytracing software (download free from their site) that produces accurate visualisations of 3D information that really give an intuitive feel for the holographic data.

Here's an example of the raw holographic data of a chain of Streptococcus cells (image is 30 micrometers on a side, the chain of cells is approximately 10 micrometers long):

Here's the same data rendered using POV-Ray. Note that the image is to scale, one check on the floor is one micrometre. The light source is directly above the rendered object, so the shadow is an XY projection that resembles a refocused version of the image in the top panel. The perspective makes the object look slightly larger than its shadow:

Updated 5/8/2013 - Fixed reconstruction bug that occurs when bandpass is off, and region of interest is wider than it is high.