-
Notifications
You must be signed in to change notification settings - Fork 4
Installation Instructions
- 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
- Skip this step unless you know what you are doing
- 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 here
- 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).
- Note: if your computer is running multiple behavior boxes (447), then you can 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.
-
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
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\svc_aind_behavior\Documents\foraging_gui_logs
- %userprofile%/.aws/credentials
- Ask Han for the credentials
- SIPE will install the AIND stage controller if that is being used
- The following environment variables need to be configured:
- STAGE_UI_VERSION=widget
- PIP_EXTRA_INDEX_URL=http://eng-tools:3141/aibs/packages
- PIP_TRUSTED_HOST=eng-tools
- Create two desktop shortcuts that switch git branches and rebuild the conda environment
- Right click on the desktop, create new shortcut
-
Users\<username>\Documents\Github\dynamic-foraging-task\src\update_scripts\update_from_github_to_main.bat
, name it "Switch to main" -
Users\<username>\Documents\Github\dynamic-foraging-task\src\update_scripts\update_from_github_to_production_testing.bat
, name it "Switch to testing"
- Click on the "BoxX.bat" you added to the desktop. The gui should initialize. If it does not, see the trouble shooting steps below.
- Press the start button to start the task. There should be audible 'beeps' as the sound cue plays for each trial. Confirm that the task runs for several trials.
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
-
Note: Git errors can be sneaky, because they sometimes masquerade as python errors. For example:
is just a git error, NOT problem with the Foraging python code.
-
Ensure git is up to date and that you are using a standalone git install, not something installed by another program (usually 'cmder'). -to check the git version, type
git --version
in the command prompt - if its less than2.30
, install a new version of git (see below).- type
where git
into a command line to see where git is installed. If there is more than one version of git and/or the git path includes cmder, then uninstall cmder:- if needed uninstall
cmder
. 'cmder' is not registered by "Add/remove programs." To remove, you will need to delete it from 'C:/Program Files/' AND THEN THE RECYCLING BIN. It is going to ask you for admin privileges to do this, and it's easier if you select "Do this for all current files." Once it is gone, install a new version of git.
- if needed uninstall
- type
-
TO INSTALL GIT: (re) install git:
- If you have not already installed the Github Desktop gui, a "good" version of git will install automatically when you do. See: https://github.com/git-guides/install-git#install-git-on-windows
- If you already did the above step, reinstalling the Desktop gui WILL NOT install git. You need to do this yourself. A link to download is here. Accept all defaults, excepting the note in the next bullet.: https://gitforwindows.org/, with more detailed instructions here if you have problems: https://github.com/git-guides/install-git#install-git-on-windows.
- NOTE: all of the default settings work here, EXCEPT that you likely already went to the trouble of installing OpenSSH. You can therefore select the "external OpenSSH" option.
-
I think I got everything under control, how do I check if it is right?
- typing
where git
into a command prompt should now point you to one and only one version of git in a stand alone program folder, e.g.:
- typing
- Try repeating the
pip install -e .
step in the dynamic-foraging-gui. This can happen if, for example, someone has changed pushed changes that change dependencies since you last ran this command.
- redo the "Allow scripts to run in PowerShell" step. Remember to run as admin, and to respond to the prompts.
- Check the Settings for the box .json in the Foraging Settings folder. Something here is probably set wrong for this computer.
Make sure the firmware on the harp boards is up to date, and that you have the and that you have the driver installed for the computer