This repository contains software for running behavioral experiments with visual cues and taste rewards, primarily designed for neuroscience research. The system integrates Pygame-based visual stimuli with hardware control for nose pokes and reward delivery.
This project consists of two main components:
- Visual Cue System: Pygame-based visual stimuli displayed on a screen
- Behavioral Control System: Hardware interface for nose pokes, reward delivery, and experiment control
- Vertical Bars: Moving vertical bars (most common cue type)
- Horizontal Bars: Moving horizontal bars
- Diagonal Bars: Moving diagonal lines
- Block Sets: Configurable patterns of moving elements
- NosePoke Class: Controls LED indicators and IR beam detection for animal interaction
- Cue Class: Manages cue presentation and timing
- GPIO Integration: Interfaces with Raspberry Pi GPIO for hardware control
- Intan Integration: Optional integration with Intan recording systems
- May_2021/: Early versions of the cue and behavioral systems
- May_2022/: Updated versions with improved functionality
- dec_2021/: Intermediate development versions
- official_experiment/: Production-ready experiment implementations
official_cuedtaste.py: Main behavioral control scriptofficial_cues.py: Main visual cue presentation scriptintan_official_cuedtaste.py: Version with Intan recording integrationwater_cue.py: Water reward variantagainst_water_cues.py: Alternative water reward paradigmcue_forward_training.py: Training protocol script
The fundamental visual element used to create cues:
class Block(pg.sprite.Sprite):
"""
Represents a moving visual element that derives from Pygame's Sprite class.
"""Interfaces with hardware for animal interaction:
class NosePoke:
"""
Controls a nose poke port with LED indicator and IR beam detection.
"""- Start the cue display on the stimulus computer:
python official_experiment/official_cues.py- Start the behavioral control on the control computer:
python official_experiment/official_cuedtaste.pyFor animal training sessions:
python official_experiment/cue_forward_training.py- Raspberry Pi (for behavioral control)
- Display monitor (for visual cues)
- GPIO-connected nose poke ports with IR beams
- Solenoid valves for taste delivery
- Optional: Intan recording system
The system uses inter-process communication between the visual cue display and the behavioral control components, allowing synchronized experiment control.
The repository contains multiple iterations of the system, with progressive improvements in functionality and reliability. The most current and stable versions are in the official_experiment/ directory.