Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
MindControl closed-loop computer vision software to manipulate neural activity in a freely moving C. elegans.
C Objective-C C++ Matlab Python

Fix potentially critical bug

On some systems, when using an illumination protocol, errant patterns may be being sent to the DLP.

These patterns occur because the cvCreateImage function does not seem to always initialize images to zero. So here we have added cvSetZero to set the temp image to zero and this has fixed the problem.
latest commit 7fc7cb0597
@aleifer aleifer authored
Failed to load latest commit information.
3rdPartyLibs Explained calibrateFG.cpp and tidied up Marc Gershow's tictoc timing …
AccessUtils Incremented submodule
MyLibs Fix potentially critical bug
ProtocolGeneration Wrote new protocol generation for flp13 to hit the ventral nerve cord.
bin Tidied up documentation in preparation for providing Nature Methods w…
.cproject added .project and .cproject back into the repo
.gitignore added .project and .cproject back into the repo
.gitmodules Converted YAML2MATLAB utils to a submodule
.project added .project and .cproject back into the repo
COPYING.GPL3 Added GPL3
README.markdown Made mindcontrol link, linkable. Updated reference
calibrate.c
calibrateFG.cpp Bugfix. The timeout of 4ms was too short for calibration. During cali…
main.cpp POTENTIALLY RESOLVED CRASH BUG
makefile fixed errant line in makefile
test.c Added some license information. Begin tidying up code.

README.markdown

Welcome to MindControl

Introduction

MindControl is a software tool that allows a researcher to utilize optogenetics to manipulate neural activity in a freely moving worm for behavioral neuroscience experiments. MindControl analyzes a video stream of a swimming nematode and in real time it generates an illumination pattern that targets specific neurons or cells within the worm. The software can output these patterns to a digital micrommirror device in a closed loop. In this way, a researcher can train arbitrary pulses of laser light only on specific cells or neurons of a worm as it moves. The software records detailed information about the worm's position, orientation and the state of the system for every frame of the video stream. This data is recorded in a human- and computer- readable YAML file. The software optionally also outputs raw and annotated video streams for later analysis. The MindControl-analysis software suite generates quantitative graphs and figures of nematode behavior based on the output from MindControl.

MindControl is the software component of CoLBeRT (Controlling Locomotion and Behavior in Real-Time) as described in Leifer, A.M., Fang-Yen, C., Gershow, M., Alkema, M., Samuel, A.D.T., "Optogenetic manipulation of neural activity in freely moving Caenorhabditis elegans," Nature Methods, in press (2010).

Authors

MindControl is written by Andrew Leifer with help from Marc Gershow. It is a product of the Samuel Lab in the Department of Physics and the Center for Brain Science at Harvard University.

Most Up To Date Version

The most up to date version of the MindControl software will always be available at http://github.com/samuellab/mindcontrol

License

With the exception of certain libraries in the 3rdPartyLibs/ folder, all of MindControl is released under the GNU Public License. This means you are free to copy, modify and redistribute this software.

How to Cite

If you use any portion of this code or software in your research, please cite:

Leifer, A.M., Fang-Yen, C., Gershow, M., Alkema, M., Samuel, A.D.T., "Optogenetic manipulation of neural activity in freely moving Caenorhabditis elegans," Nature Methods, in press (2010).

Requirements

The software was developed on Intel hardware running Windows XP. It was compiled with the MinGW gcc compiler. The software has different requirements depending on whether you plan to compile the code, or run an existing pre-compiled binary. Moreover, there are different compile targets and executables for different hardware environments. For example, to control a micromirror device requires compiling an executable that links to commercial software libraries included with the micromirror device.

Quick Start

The quickest way to get a feel for the software is to run the VritualMC.exe pre-built executable which is packaged in a zip file and availabe for download at http://github.com/downloads/samuellab/mindcontrol/MindControlDEMO.zip VirtualMC.exe will run on any Windows XP system and requires only the included OpenCV 1.1 run-time libraries. No special hardware is required. Follow the README in the zip.

Compiling Your Own Binaries

To utilize camera or micromirror hardware functionality, you will need to compile the software from source.

The code compiles under Windows XP. At a minimum it requires:

  • mingw
  • OpenCV 1.1
  • msysgit
  • make
  • awk

To compile any of the calibration routines additionally requires:

  • MATLAB

To compile an executable that uses a camera and DLP requires

  • BitFlow framegrabber SDK
  • VIALUX ALP Basic DLP USB SDK

See the makefile for more details about the different compile targets.

Contact

Please contact Andrew Leifer, leifer (at) fas (dot) harvard.edu with questions or feedback.

Something went wrong with that request. Please try again.