Description
Visiomode is an open-source platform for building touchscreen-based behavioral tasks for rodents. It leverages the inherent flexibility of touchscreens to offer a simple yet adaptable software and hardware platform. Built on the Raspberry Pi computer, it combines a web-based interface and powerful plug-in system with an operant chamber that can be adapted to generate a wide range of behavioral tasks.
NWB Integration
Visiomode session data can be exported to the NWB format directly from the web interface. Navigate to the “History” tab, choose the session you wish to export and select “NWB” from the “Download” dropdown menu.
Data Structure
Visiomode stores behavioral data under trials
with the following columns:
start_time
: Trial start timestop_time
: Trial end timestimulus
: Stimulus identifiercue_onset
: Cue presentation timeresponse
: Response type (e.g., touch on left/right)response_time
: Touch timepos_x
: Touch x-coordinatepos_y
: Touch y-coordinatedist_x
: Touch drag distance (x)dist_y
: Touch drag distance (y)outcome
: Trial outcomecorrection
: Correction trial indicatorsdt_type
: Signal detection theory classification
Resources
Example Code
from pynwb import NWBHDF5IO, TimeSeries
# Load the Visiomode NWB file
io_behavior = NWBHDF5IO("/path/to/visiomode-behavior.nwb", "r")
nwbfile_behavior = io_behavior.read()
# Load an NWB file with neurophysiological data
io_neurophys = NWBHDF5IO("/path/to/neurophys.nwb", "r")
nwbfile_neurophys = io_neurophys.read()
# Recalculate timestamps relative to behavior file
timestamp_offset = (
nwbfile_neurophys.session_start_time - nwbfile_behavior.session_start_time
).total_seconds()
recalc_timestamps = [
timestamp - timestamp_offset
for timestamp in nwbfile_neurophys.acquisition["DataTimeSeries"].timestamps
]
# Link neurophysiological data
neurophys_timeseries = TimeSeries(
name="DataTimeSeries",
data=nwbfile_neurophys.acquisition["DataTimeSeries"].data,
timestamps=recalc_timestamps,
description="Neurophysiological data"
)
nwbfile_behavior.add_acquisition(neurophys_timeseries)
# Export to new NWB file
io_linker = NWBHDF5IO("/path/to/linker-behavior+phys.nwb", "w")
io_linker.write(nwbfile_behavior, link_data=True)
# Clean up
io_behavior.close()
io_neurophys.close()
io_linker.close()