New version of two photon imaging code
Complete Guide to 2P Code Installation and Use
This toolbox is designed to allow the user to present visual stimuli using pyschophysics toolbox and sync experimental events with Bruker Prairie Two Photon Systems. This toolbox also contains a number of analysis scripts to extract stimulus driven Calcium transient activity from imaging recordings.
Hardware requirements:
- One Bruker-Prairie two photon imaging system (Ultima etc)
- One Windows computer with graphics card compatible with psychtoolbox
- RECOMMENDED, separate Windows analysis computer with good GPU (GTX 1070 and above).
- Interface box to communicate between stimulus computer and Bruker system (Measurement Computing USB-1408FS preferred)
Software requirements for analysis computer:
- Download toolbox and add to Matlab path
- Install psychophysics toolbox (http://psychtoolbox.org/)
- If you want to be able to use no rigid motion correction please clone the non-rigid motion correction toolkit (https://github.com/flatironinstitute/NoRMCorre)
- Install an up to date version of FIJI (https://fiji.sc/)
- Connect FIJI with matlab as explained here (http://bigwww.epfl.ch/sage/soft/mij/) NB, instead of using ij.jar, place the up to date version from your FIJI package (FIJI.app/jars), it will be named something like ij-1.52g.jar into the MATLAB folder.
- Install Cell Magic Wand into FIJI (https://www.maxplanckflorida.org/fitzpatricklab/software/cellMagicWand/) OR (https://github.com/GrimmSnark/Cell_Magic_Wand)
- Install CaImAn-MATLAB analysis package from github, this package uses some of their functions (https://github.com/flatironinstitute/CaImAn-MATLAB ).
- You may need to increase your java heap size for FIJI and matlab to work with large images see (https://www.mathworks.com/matlabcentral/answers/92813-how-do-i-increase-the-heap-space-for-the-java-vm-in-matlab-6-0-r12-and-later-versions) NB use the java.opts method.
- You will need to modify the "intializeMIJ.m" to your local FIJI path.
Software requirements for stimulus computer:
- Download toolbox and add to Matlab path
- Install psychophysics toolbox (http://psychtoolbox.org/)
- Install Measurement Computing USB-1408FS and MC package for Matlab
Stimulus computer setup: This system uses an analogue to digital conversion to communicate between the stimulus computer and the Bruker-Prairie two photon imaging system. This is achieved by splitting up the output range of the MC USB 1408FS (0-4V) into 255 discrete levels which are used to produce pulses by the stimulus computer which are recorded by the Bruker-Prairie two photon imaging system. These pulses are used event numbers to synchronize the experimental stimulus to the functional imaging. This conversion requires set up in the following procedure:
- Follow MC USB1408FS instructions to connect the first analogue channel out (AO0) to the first analogue in (AI0) on the Bruker- Prairie System
- Follow MC USB1408FS instructions to connect the digital port A to the trigger input on the Bruker- Prairie System
- Set up TSeries run on the Bruker- Prairie System, ensure that the ‘start with external trigger button’ is selected. Be sure that you have the ‘voltage recording’ set up to record the first analogue channel.
- Run testDAQOutSignal and save the resulting TSeries data. We are only interested in the voltage excel file.
- Copy this TSeries folder to the stimulus computer and run readEventFileSetup.m to create PrairieVoltageInfo.mat, which contains the event voltage level information which is the basis of the stimulus computer to Bruker computer communication.
- Open readEventFilePrairie and change the “keyFilepath” variable to the location of the newly created PrairieVoltageInfo.mat.
- Set up stimulus monitor position and create entry in degreeVisualAngle2Pixels so that stimulus are created as the correct size. NB Make sure all PTB experiment scripts run use the correct setup number.
Now you can run stimulus experiment code from the PTB_Experiments folder.
Please refer to the documents in the "Doc" folder for more setup and usage information
Any questions please email msavage@uabmc.edu