Configure behavior & recording systems

Configure new behavior rig system

First steps

Mount cup PNI 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 (note that PRINCETON can be upper or lower case) where netid is your PU NetID.

Install MATLAB 2020a or higher

Download and install NiDAQmx from National Instruments website

Download and install Microsoft Visual Studio community.

  1. Make sure to select a version that is compatible with the Matlab version installed which typically means ensure the VS Community year is older than the Matlab Year (e.g., VS Community 2022 for Matlab R2024a).
  2. Be sure to install the option desktop development with C++

Install Git for Windows

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

Create ssh key to clone repositories

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

Add key to virmen user in github

  1. Copy ssh public key to clipboard in Git Bash clip < ~/.ssh/id_ed25519.pub
  2. Open githubopen in new window
  3. Login with vrrigs user (ask your Lab Manager for password)
  1. Access Settings -> SSH and GPG Keys
  1. Click New SSH Key button
  2. Add a meaningful title to the key and paste public key from the clipboard in "Key" text area.
  3. Click Add SSH Key button

Compiler

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

U19-pipeline-matlab Repository

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

MATLAB Instructions

  1. Run dj_initial_conf(0)
  2. Insert user and password for the DB

Virmen Repository

  1. Create C:\Experiments directory
  2. Open Git Bash and execute: cd /c/Experiments.
  3. Execute in git config --global user.email "alvaroluna.pni@gmail.com".
  4. Clone Virmen Repository, called TankMouseVR git clone https://github.com/BrainCOGS/TankMouseVR.git.
  5. Rename directory C:\Experiments\TankMouseVR to C:\Experiments\ViRMEn.

MATLAB Instructions

  1. run install_virmen inside C:\Experiments\ViRMEn
  • If compilation fails. Run mex -setup c++ to select Visual Studio C++ Compiler
  1. Open file C:\Experiments\ViRMEn\RigParameters.m and edit corresponding variables:
  • rig: (RigName on the format: Room#-"Rig"#-T)
  • rig_type: (miniVR or NormalVR)
  • add NIDAQ Channles in corresponding variables (Ask lab manager about these parameters)
  • Mini VR projection parameters (Ask lab manager about these parameters)
  1. run lab.utils.add_behavior_rig(RigParameters.rig).
  2. run live_calibration experiment (Ask lab manager about this process).
  3. Create a MATLAB shortcut and set Start in as C:\Experiments\ViRMEn.
  4. Add this shortcut to the Windows task bar in the bottom.

Behavior data backup task schedule

  1. On Windows type "Task Scheduler"
  2. Open Task Scheduler "App"
  3. On right hand side menu, click on "Create Task" Action
  1. Name new task as new_data_backup
  1. Add a trigger to run task daily at 11:00 pm
  1. Add an action: add this line to the Program/script edit: C:\Experiments\U19-pipeline-matlab\scripts\cmd_copy_behavior_files
  1. Hit OK button

Modify the Sleep Behaviors

To prevent the screen from turning off while the subjects are training

  1. Under the ("Power & Sleep")[ms-settings:powersleep?activationSource=SMC-IA-4027067] (settings)[https://support.microsoft.com/en-us/windows/how-to-adjust-power-and-sleep-settings-in-windows-26f623b5-4fcc-4194-863d-b824e5ea7679] within Windows, set "Turn my screen off after" to the longest option possible.
  2. Additionally, set the "Make my device Sleep after" to the longest option possible.

Configure new recording system

  • First install all things necessary for appropiate recording modality. (Spike GLX 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 (note that PRINCETON can be upper or lower case) where netid is your PU NetID.
  2. Copy 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.
  • On Anaconda advanced options step: check "Add Anaconda3 to my PATH environment variable" checkbox.
  1. Run Desktop\AutomationGUI_update\update_AutomationGUI.BAT
  2. Follow instructions to install Recording Automation GUI. (Also called Workflow Console GUI).

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: (on the format: Room#-Recording).
  • modality: (one of the following: electrophysiology, 2photon, 3photon, mesoscope).