Two-Photon Processor (TPP) is a versatile, ready-to-use, and freely available software package in MATLAB to process data from in vivo two-photon calcium imaging. TPP includes routines to search for cell bodies in full-frame (Search for Neural Cells Accelerated; SeNeCA) and line-scan acquisition, routines for calcium signal calculations, filtering, spike-mining, and routines to construct parametric fields.
Searching for somata in artificial in vivo data, our algorithm achieved better performance than human annotators. SeNeCA copes well with uneven background brightness and in-plane motion artifacts, the major problems in simple segmentation methods.
In the fast mode, artificial in vivo images with a resolution of 256 x 256 pixels containing similar to 100 neurons can be processed at a rate up to 175 frames per second (tested on Intel i7, 8 threads, magnetic hard disk drive). This speed of a segmentation algorithm could bring new possibilities into the field of in vivo optophysiology.
With such a short latency (down to 5-6 ms on an ordinary personal computer) and using some contemporary optogenetic tools, it will allow experiments in which a control program can continuously evaluate the occurrence of a particular spatial pattern of activity (a possible correlate of memory or cognition) and subsequently inhibit/stimulate the entire area of the circuit or inhibit/stimulate a different part of the neuronal system. TPP will be freely available on our public web site.
Similar all-in-one and freely available software has not yet been published.