Step 3: Move experiment to test environment
Once your experiment is running, you need to test it in the target environment.
This is typically:
- a behavioural lab
- the MRI lab
Testing ensures that your experiment runs correctly with the actual hardware setup.
MRI lab workflow
If you used the PsychoPy template, your project should include:
experiment.psyexprequirements.txt
Before testing at the scanner, you should first test your experiment on a clone of the MRI stimulus computer at CCNS.
1. Log in
Log in to the ANC user account on the cloned computer.
Note — Python version
The ANC user account uses Python 3.8.10.
This matches the recommended version for the PsychoPy template.
If needed, a different environment can be set up for your group.
2. Clone your project
- Open the Documents folder
- Right-click → Open Git Bash
- Run:
git clone <experiment-repository>
3. Create a virtual environment
- Open the Command Prompt
- Navigate to your project:
cd <path-to-project>
python -m venv %USERPROFILE%\environments\<project_id>
%USERPROFILE%\environments\<project_id>\Scripts\activate.bat
pip install -r requirements.txt
- Optional: deactivate environment
deactivate
4. Test your experiment
- Activate environment (if needed):
%USERPROFILE%\environments\<project_id>\Scripts\activate.bat
- Navigate to your project:
cd <path-to-project>
3.
psychopy experiment.psyexp
Important — saving changes
If you modify your experiment, always commit and push changes to your repository!
5. Test at the MRI scanner
Once your experiment works on the cloned computer:
- Log in to the ANC account on the MRI stimulus computer
-
Disable flight mode to enable network access
-
Repeat the same steps: - clone repository
- create environment
- install dependencies -
Before running the experiment: - enable flight mode again
Important — timing stability
Always enable flight mode during testing.
Network activity can affect timing accuracy.
Behavioural lab (simple testing)
If you are running a behavioural experiment (no MRI/MEG):
- Run your experiment on the target computer
- Verify that timing and responses are recorded correctly
- Check that your
events.tsvfile matches your planned structure
In most cases, no special setup is required beyond your normal experiment environment as mentioned in the steps above!
Updating your experiment
If you make changes during testing:
- push changes to your repository
- you may need to toggle flight mode to sync changes