Demixing Calcium Imaging Data in C. elegans via Deformable Non-negative Matrix Factorization


Nejatbakhsh, A., et al. Demixing Calcium Imaging Data in C. elegans via Deformable Non-negative Matrix Factorization. Medical Image Computing and Computer Assisted Intervention – MICCAI 2020 14–24 (2020).


Extracting calcium traces from the neurons of C. elegans is an important problem, enabling the study of individual neuronal activity and the large-scale dynamics that govern behavior. Traditionally, non-negative matrix factorization (NMF) methods have been successful in demixing and denoising cellular calcium activity in relatively motionless or pre-registered videos. However, in the case of C. elegans or other animal models where motion compensation methods fail to stabilize the effect of even mild motion in the imaging data, standard NMF methods fail to capture cellular footprints since these footprints are variable in time. In this work, we introduce deformable non-negative matrix factorization (dNMF), which models the motion trajectory of the underlying image space using a polynomial basis function. Spatial footprints and neural activity are optimized jointly with motion trajectories in a matrix tri-factorization setting. On simulated data, dNMF is demonstrated to outperform currently available demixing methods as well as methods that account for motion and demixing separately. Furthermore, we display the practical utility of our approach in extracting calcium traces from C. elegans microscopy videos. The extracted traces elucidate spontaneous neural activity as well as responses to stimuli. Open source code implementing this pipeline is available at

Publisher's Version

Last updated on 07/30/2021