-
Notifications
You must be signed in to change notification settings - Fork 4
Installation Instructions
yonibrowning edited this page Jun 12, 2024
·
60 revisions
- Open GitHub Desktop, click clone from URL
- URL:
https://github.com/AllenNeuralDynamics/dynamic-foraging-task.git
- installation directory should be
C:\Users\svc_aind_behavior\Documents\GitHub\
- In a file window, open
C:\Users\svc_aind_behavior\Documents\GitHub\dynamic-foraging-task\bonsai
- Click on
setup.cmd
- following the instructions here.
- follow the instruction here
- following the instructions here.
- firmware is stored in \allen\aind\scratch\Xinxin\SoundcardFirmware.
- install
conda
instructions here - Add conda to the path variable
- instructions from here
- Open Advanced System Settings
- Click on "Environment Variables", then "Edit Path", then add the following paths:
- C:\Users\svc_aind_behavior\AppData\Local\miniconda3
- C:\Users\svc_aind_behavior\AppData\Local\miniconda3\Scripts
- C:\Users\svc_aind_behavior\AppData\Local\miniconda3\Library\bin
- C:\Users\svc_aind_behavior\AppData\Local\miniconda3\condabin
- If you see an entry for
AppData\Local\Microsoft\WindowsApps
move this path entry to the bottom
- Open
miniconda3 prompt
, and typeconda init
. Close, and reopen the prompt - Create an environment:
conda create -n Foraging python=3.11
- Open
miniconda3 prompt
- Activate the environment:
conda activate Foraging
- change to the directory:
C:\Users\svc_aind_behavior\Documents\GitHub\dynamic-foraging-task
- run
pip install -e .
- This should install all the required python packages.
- If you encounter errors in dependency or finding repositories, see below for trouble shooting.
- Copy
dynamic-foraging-task/src/setting_templates/Settings_box<box num>.csv
toUsers\svc_aind_behavior\Documents\ForagingSettings
- Copy
<box num>
1-4 depending on the computer (A,B,C,D maps to 1,2,3,4) - Configure the Behavior/Soundcard COM ports for each computer (instruction to find COM ports)
- Unplug the USB cables for the Behavior and Soundcard boards for one of the two behavior boxes connected to each computer.
- In a file browser, navigate to
C:\Users\svc_aind_behavior\Documents\GitHub\dynamic-foraging-task\bonsai
- Click on
Bonsai
, thenNew Project
- In the Toolbox window type
Device (Harp)
- Select the Node, then in the side tab in the main editor, iterate through the COM Ports and look in the console window, which will tell you which board is connected to which COM port. Note, it's not recommended to change COM ports in a Device-node-window that pops up when you double click the Device node as it causes glitchy behavior. Dedicated node such as
Device (Harp.Behavior)
could be more stable. - Plug in the other behavior box's boards and repeat the steps.
- The BonsaiOsc ports are determined by the box number, and should not be modified.
-
AINDLickDetector
: use1
if using the AIND Lickity Split detector,0
otherwise- If using the AIND lick detector, then you need to set the following fields:
-
LeftLickDetector
: COM port for the left lick detector -
RightLickDetector
: COM port for the right lick detector
-
HighSpeedCamera
: use0
if not using high speed cameras,1
otherwise- The following settings are only relevant if
HighSpeedCamera
is enabled: -
HasSideCameraLeft
: use0
if not using a high speed left camera,1
otherwise -
HasSideCameraRight
: use0
if not using high speed right camera,1
otherwise -
HasBodyCamera
: use0
if not using high speed body camera,1
otherwise -
HasBottomCamera
: use0
if not using high speed bottom camera,1
otherwise -
SideCameraLeft
: serial number for high speed left side camera (instruction to find serial number) -
SideCameraRight
: serial number for high speed right side camera -
BodyCamera
: serial number for high speed body camera -
BottomCamera
: serial number for high speed bottom camera -
codec
The codec for high speed camera encoding
- The following settings are only relevant if
- Copy
- Copy
dynamic-foraging-task\src\desktop_shortcuts\Box<box num>.bat
to the Desktop - Copy
<box num>
A-D depending on the computer - Repeat for
Box<box num> with console.bat
- Make a folder
Users\svc_aind_behavior\Documents\ForagingSettings
- Copy the template from
dynamic-foraging-task\src\setting_templates\ForagingSettings.json
toUsers\svc_aind_behavior\Documents\ForagingSettings\ForagingSettings.json
- You should not have to modify these settings:
- "bonsai_path":"C:\Users\svc_aind_behavior\Documents\Github\dynamic-foraging-task\bonsai\Bonsai.exe",
- "bonsaiworkflow_path":"C:\Users\svc_aind_behavior\Documents\Github\dynamic-foraging-task\src\workflows\foraging.bonsai"
- "default_saveFolder": "C:\Documents\"
- "temporary_video_folder":"C:\Users\svc_aind_behavior\Documents\temporaryvideo\",
- "show_log_info_in_console":false (only used for debugging)
- This field is mandatory and must be configured for each computer:
- "current_box": For example "447-1". For computers in 446/447, use "447-<tower_number>", for example: , "447-1"
- These settings need to be configured for each computer:
- "Teensy_COM": For example "COM10",
- This is only for fiber-photometry
- Follow instructions on the wiki to install Arduino IDE (1.8x) and TeensyDuino
- Once both are installed open ArduinoIDE, go to Tools>Port, select COMport cooresponding to Teensy4.1, and this value to the ForagingSettings.json
- "FIP_workflow_path":
- This is only for fiber-photometry
- A string path to the
ThorFIP.bonsai
workflow in theFIP_DAQ_control
repo
- "newscale_serial_num_box1": For example 46103
- "newscale_serial_num_box2": For example 46104
- "newscale_serial_num_box3": For example 46105
- "newscale_serial_num_box4": For example 46106
- Determine the serial numbers of the Newscale Stages
- Unplug the stages for one of the two boxes
- Open Miniconda Prompt
- type
conda activate Foraging
- navigate to
dynamic-foraging-task/src/foraging)gui
python
from MyFunctions import NewScaleSerialY
serial_num = NewScaleSerialY.get_instances()[0]
- Edit
ForagingSettings.json
to add a line"newscale_serial_num_box1":<serial number for rig 1>
- (A,B,C,D maps to 1,2,3,4)
- Determine the serial numbers of the Newscale Stages
- "Teensy_COM": For example "COM10",
- You should not have to modify these settings:
- Create a log file folder at
Users\Documents\foraging_gui_logs
Open Powershell as an Administrator, then type the following command Set-ExecutionPolicy RemoteSigned
Make sure the NIDaq software is installed
- Open Advanced System Settings
- Click on "Environment Variables"
- Under
System Variables
, delete any entries forPIP_INDEX_URL
andPIP_TRUSTED_HOST
Ensure git is up to date
-
git --version
in the command prompt - if its less than
2.30
, install a new version of git (see below). - make sure only one version of git is installed
where git
- if needed uninstall
cmndr
. 'cmnder' is not registered by "Add/remove programs." To remove, you will need to delete it from 'C:/Program Files/' AND the recycling bin. Once it is gone, install a new version of git. - TO INSTALL GIT: (re) install git:
- open the anaconda/miniconda prompt. Activate the Foraging enviornment:
conda activate Foraging
- use conda to install git: 'conda install git'
- use 'git --version' to confirm that everything worked.
- open the anaconda/miniconda prompt. Activate the Foraging enviornment:
Make sure the firmware on the harp boards is up to date