Visiomode

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.

Visiomode Graphical Abstract

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.

Visiomode NWB Export

Data Structure

Visiomode stores behavioral data under trials with the following columns:

  • start_time: Trial start time
  • stop_time: Trial end time
  • stimulus: Stimulus identifier
  • cue_onset: Cue presentation time
  • response: Response type (e.g., touch on left/right)
  • response_time: Touch time
  • pos_x: Touch x-coordinate
  • pos_y: Touch y-coordinate
  • dist_x: Touch drag distance (x)
  • dist_y: Touch drag distance (y)
  • outcome: Trial outcome
  • correction: Correction trial indicator
  • sdt_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()