Implementation of Dynamic Differential Microscopy (DDM) in Python.
- Fourier transform GPU acceleration
- Clever memory management
- Fitting arbitrary models of particles, including multiple particles and polydispersity
- Automated structure function fitting
- Python 3.6
- Numpy, ...
- CUDA capable GPU
Fitting of a model using DDM requires as an input a map of
We take a stack of 2d square images with one channel (i.e. grayscale images), such that the total number is N. For each value of
Subsequently each averaged 2D Fourier transform image is radially averaged, collapsing the 2 dimensional Fourier image into a one dimensional function. The image ought to be isotropic, but is not due to finite sampling length and stochastic noise. It may also be non-isotropic because the transport properties of the sample are non-isotropic: i.e. if there's a leak in the sample chamber, liquid may leak north to south, so that
The one dimensional map (the raw image structure function), its uncertainty, and the movie framerate is stored in a dictionary and serialized, while the original image stack and related data is discarded. Such a proceedure is necessary as typically each framestack will be several gigabytes in size, and there may be thousands of framestacks to process. Decoupling image structure acquisition and model fitting is therefore essential. For a one thousand frame stack, with each frame being of width 1024 pixels, acquisition of the image structure function takes around a minute using GPU accelerated Fourier transforms.
The serialized data is then read back into Python. In general, transport properties are calculated by fitting a theoretically motivated model to the image structure function. Typical models are given here
- A set of monodisperse particles undergoing Brownian motion:
$I(q) = A(q) (1-e^{-t D/\tau^2}) + B(q)$ . - A set of monodisperse particles undergoing Ballistic motion:
$I(q) = A(q) (1-e^{-t v / \tau}) + B(q)$ . - A more general model where particles are (all) undergoing some process on the continuum between anomylous subdiffusion and superdiffusive motion:
$I(q) = A(q) (1-e^{-t D' / \tau^\alpha}) + B(q)$ . Here$\alpha$ varies between$1$ (indicating superdiffusive motion), to$2$ (diffusion), to values above two (indicating anomylous subdiffusion). - A mixture of monodisperse particles undergoing different kinds of transport:
$I(q) = B(q) + \sum_i A_i(q) (1-e^{1-t D / \tau_i^{\alpha_i}})$ . - A polydisperse population of particles,
The statistically optimal method of fitting