Skip to content

Configure behavior & recording systems ​

Configure a new behavior rig ​

First steps ​

Mount the PNI cup drives ​

  1. From Windows Explorer, select "Map Network Drive" and enter:
  • \\cup.pni.princeton.edu\braininit\ (for braininit)
  • \\cup.pni.princeton.edu\u19_dj\ (for u19_dj)
  1. Authenticate with your NetID and PU password (NOT your PNI password, which may be different). When prompted for your username, enter PRINCETON\netid (PRINCETON can be upper or lower case), where netid is your PU NetID.

Install MATLAB R2020a or later ​

Download and install NI-DAQmx from the National Instruments website ​

Download and install Microsoft Visual Studio Community ​

  1. Select a version compatible with the installed MATLAB version. This typically means a Visual Studio release year earlier than the MATLAB release year (e.g., VS Community 2022 for MATLAB R2024a).
  2. Make sure to install the "Desktop development with C++" workload.

Install Git for Windows ​

  1. Install it from this link.
Installation options ​
  • Use Git from the Windows Command Prompt (5th pane)
  • Checkout as-is, commit as-is (6th pane)

Create an SSH key to clone repositories ​

  1. Open Git Bash.
  2. ssh-keygen -t ed25519 -C "vrrigsbi@princeton.edu"
  3. Leave the passphrase empty (press Enter twice).
  4. eval "$(ssh-agent -s)"
  5. ssh-add ~/.ssh/id_ed25519

Add the key to the vrrigs user on GitHub ​

  1. Copy the ssh public key to the clipboard in Git Bash: clip < ~/.ssh/id_ed25519.pub
  2. Open GitHub.
  3. Log in as the vrrigs user (ask your lab manager for the password).
Vrrigs GitHub login
Vrrigs GitHub login
  1. Go to Settings -> SSH and GPG keys.
Vrrigs ssh keys section
Vrrigs ssh keys section
  1. Click the New SSH key button.
  2. Add a meaningful title for the key and paste the public key from the clipboard into the "Key" text area.
  3. Click the Add SSH key button.

Compiler ​

  1. Install the Visual Studio C++ compiler from https://visualstudio.microsoft.com/downloads/, making sure to select C++ support.
  2. In MATLAB, run mex -setup -v. This sets up the compiler. It should output something like "Microsoft Visual C++ 202X".

U19-pipeline-matlab repository ​

  1. Open Git Bash and execute: cd /c/Experiments
  2. Clone the U19-pipeline-matlab repository: git clone git@github.com:BrainCOGS/U19-pipeline-matlab.git

MATLAB instructions ​

  1. Run dj_initial_conf(0).
  2. Enter the DB user name and password.

ViRMEn repository ​

  1. Create the C:\Experiments directory
  2. Open Git Bash and execute: cd /c/Experiments.
  3. Execute git config --global user.email "vrrigsbi@princeton.edu".
  4. Clone the ViRMEn repository: git clone git@github.com:BrainCOGS/ViRMEn.git.

MATLAB instructions ​

  1. Open MATLAB as Administrator.
  2. Run install_virmen inside C:\Experiments\ViRMEn.
  • If compilation fails, run mex -setup c++ to select the Visual Studio C++ compiler.
  1. Run:
  • import_scheduled_tasks(1) if this is a rig in room 165 (or one mainly managed by techs)
  • import_scheduled_tasks(0) if this is an acquisition (ephys/imaging) rig or a rig managed by researchers
  1. Open the file C:\Experiments\ViRMEn\RigParameters.m and edit the corresponding variables:
  • rig: (RigName in the format: Room#-"Rig"#-T)
  • rig_type: (miniVR or NormalVR)
  • NI-DAQ channels, in the corresponding variables (ask your lab manager about these parameters)
  • Mini VR projection parameters (ask your lab manager about these parameters)
  1. Run lab.utils.add_behavior_rig(RigParameters.rig).
  2. Run the live_calibration experiment (ask your lab manager about this process).
  3. Create a MATLAB shortcut and set Start in to C:\Experiments\ViRMEn.
  4. Pin this shortcut to the Windows taskbar.
MATLAB Shortcut example
MATLAB Shortcut example

MATLAB add-ons ​

If not all toolboxes were installed with MATLAB, make sure these add-ons are installed:

  • Image Acquisition Toolbox
  • Image Processing Toolbox
  • Image Acquisition Toolbox Support Package for GenICam Interface
  • Image Acquisition Toolbox Support Package for OS Generic Video Interface
  • PsychToolbox
  • Statistics and Machine Learning Toolbox
  • Instrument Control Toolbox
  • Data Acquisition Toolbox
  • Zaber

Change the sleep settings ​

To keep the screen from turning off while subjects are training:

  1. In Windows Power & Sleep settings, set "Turn my screen off after" to the longest option.
  2. Also set "Make my device sleep after" to the longest option.

Configure a new recording system ​

  • First, install everything necessary for the appropriate recording modality (SpikeGLX for electrophysiology, ScanImage for imaging).
  1. From Windows Explorer, select "Map Network Drive" and enter:
  • \\cup.pni.princeton.edu\braininit\ (for braininit)
  • \\cup.pni.princeton.edu\u19_dj\ (for u19_dj)
  1. Authenticate with your NetID and PU password (NOT your PNI password, which may be different). When prompted for your username, enter PRINCETON\netid (PRINCETON can be upper or lower case), where netid is your PU NetID.
  2. Copy the Automation GUI files: copy \\cup.pni.princeton.edu\braininit\Shared\AutomationGUI_Installation\AutomationGUI_update to the Desktop.
  3. Run Desktop\AutomationGUI_update\firstTimeAutomationGUI.BAT.
  • Install Git Bash and Anaconda from it.
Anaconda advanced options step
Anaconda advanced options step
  • On the Anaconda advanced options step, check the "Add Anaconda3 to my PATH environment variable" checkbox.
  1. Run Desktop\AutomationGUI_update\update_AutomationGUI.BAT.
  2. Follow the instructions to install the Recording Automation GUI (also called the Workflow Console GUI).
Recording Automation GUI installer
Recording Automation GUI installer

Register recording system ​

On a computer with access to the database (e.g., any rig computer):

  1. Open MATLAB.
  2. Execute: lab.utils.add_recording_system((recording_system_name), (modality)) where:
  • recording_system_name: (in the format: Room#-Recording).
  • modality: (one of the following: electrophysiology, 2photon, 3photon, mesoscope).

Made by BRAIN CoGS at Princeton Neuroscience Institute