Settings File

Open the "settings.py" file to adjust common settings across your applications. This includes adding instruction and rating text, setting up 360 video regions of interest, setting the window size, initiating Biopac,  enabling/disabling the mouse lock, enabling the heatmap (as well as using a live heatmap view),  showing the gazePath after an initial trial, and which vizconnects you wish to use, toggling on or off the headlight, HUD, console text and fade Quad, adjusting the bit rate of saved videos and file type and more. 

To change any of these settings per script you can use code similar to this (this is for the FadeQuad and Console Text). You just need to add this before importing sightlab into your script:

import settings
def update_settings(setting_name, value):

setattr(settings, setting_name, value)


# Update settings

update_settings('FADE_QUAD', False)

update_settings('CONSOLE_TEXT', False)

import viz

import vizshape

import vizinput

import os


#Change the size of the main window

WINDOW_SIZE = (1280, 720)


#Turn the default headlight on or off 

HEADLIGHT_OFF = True


#Set to true to enable communication with Biopac Acqknowledge. Can also use GUI checkbox

BIOPAC = False 


#Toggle the ability to lock the mouse to the mirrored window

MOUSE_LOCK = False


#Fixation/ Gaze Time threshold

THRESHOLD = 0.5

THRESHOLD_360 = 0.5


#Angles in degree for fixation detection

FIXATION_ANGLE = 1


#Set to true if using time duration and spatial degree for fixations

USE_SPATIAL_PLUS_THRESHOLD = False


#Regions of interest options for 360 videos

REGION_1 = vizshape.addSphere(radius=.08, color=viz.RED, alpha=0.0)

REGION_2 = vizshape.addSphere(radius=.08, color=viz.BLUE, alpha=0.0)

REGION_3 = vizshape.addSphere(radius=.08, color=viz.GREEN, alpha=0.0)

REGION_4 = vizshape.addSphere(radius=.08, color=viz.YELLOW, alpha=0.0)


REGION_1_POSITION = (-0.95,-0.08, 0.27 )

REGION_2_POSITION = (0.44, -0.44, 0.77  )

REGION_3_POSITION = (-0.69 ,-0.08,0.70)

REGION_4_POSITION = (-0.84,-0.09,0.51 )


REGION_1_NAME = 'fixationRegion1'

REGION_2_NAME = 'fixationRegion2'

REGION_3_NAME = 'fixationRegion3'

REGION_4_NAME = 'fixationRegion4'


#Toggle Overlays Keys

TOGGLE_OVERLAYS_KEY = 'h'

TOGGLE_MIRRORED_GAZE_POINT_KEY = 'i'


SCREEN_CAPTURE_KEY = '/'


#Show or hide the HUD

HUD_ON = True


#Show or hide the FadeQuad

FADE_QUAD = True


#Show or hide the Console Text

CONSOLE_TEXT = True


#Toggle on or off the real time heatmap to run alongside the main experiment(otherwise this will show only in SessionReplay)

HEATMAP_FLAG = 0


#Toggling this will enable the real time heatmap to be seen (note that the HEATMAP_FLAG needs to be set to "1" 

HEATMAP_VISUAL_FLAG = 0


HEATMAP_360_FLAG = 0

HEATMAP_360_VISUAL_FLAG = 0


#1 is TOP_BOTTOM, 2 is LEFT_RIGHT_180

STEREO_VIDEO_TYPE = 1


#Toggle to show the gaze path to a participant (otherwise this will show only in SessionReplay)

SHOW_GAZE_PATH = False


#Key to continue the experiment after the gaze path

GAZE_PATH_CONTINUE_KEY = ' '


#Adjust the sensitivity of the saccades (red lines) in the gaze path. Default - 1,10,100

LINE_FREQUENCY = 1

SACCADE_ANGLE1 = 10

SACCADE_ANGLE12 = 100


#Default key for running experiment

CONTINUE_EVENT_KEY = " "

TRIAL_START_EVENT = id('TRIAL_START_EVENT')

TRIAL_END_EVENT = id('TRIAL_END_EVENT')


#Add to this if you have a custom vizconnect file you would like to use

vizconnect_dict = { 'Vive Pro Eye': 'vizconnect_config_vive_pro.py',

'Pupil Labs': 'vizconnect_config_vive_pupil_labs.py',

'Vive Tobii': 'vizconnect_config_vive_tobii.py',

'Desktop': 'vizconnect_config_desktop_3d.py',

'Desktop_360': 'vizconnect_config_desktop_360.py',

'Meta No Eyetracker':'vizconnect_config_oculus_simulate.py',

'Vive/ Vive Pro, Vive Pro 2': 'vizconnect_config_vive.py',

'StarVROne': 'vizconnect_config_starVR.py',

'HP Omnicept':'vizconnect_config_omnicept.py',

'Vive Focus 3':'vizconnect_config_vive_focus.py',

'Driving Desktop': 'vizconnect_config_desktop_driving.py',

'Driving Vive': 'vizconnect_config_vive_pro_driving.py',

'Driving Omnicept':'vizconnect_config_omnicept_driving.py',

'Driving SteamVR': 'vizconnect_config_vive_driving.py',

'Driving Meta': 'vizconnect_config_meta_driving.py',

'Driving Quest Pro': 'vizconnect_config_openxr_driving.py',

'Meta Quest Pro': 'vizconnect_config_openxr.py',

'Meta Pro Hand': 'vizconnect_config_meta_hand.py',

'Varjo': 'vizconnect_config_varjo.py',

'PPT HMD':'vizconnect_config_hmd_PPT.py',

'Meta Quest 3':'vizconnect_quest_3.py',

'Meta':'vizconnect_config_oculus_simulate.py',

'SteamVR':'vizconnect_config_steamvr.py'}


VIZCONNECT_CONFIGS = ['Desktop','Vive Pro Eye','Vive Focus 3','HP Omnicept','SteamVR' , 'Meta Quest Pro','Meta No Eyetracker','Meta Quest 3','Vive/ Vive Pro, Vive Pro 2','Meta Pro Hand','Varjo','Pupil Labs', 'StarVROne','Vive Tobii','PPT HMD']

VIZCONNECT_CONFIGS_360 = ['Desktop_360','Vive Pro Eye','Vive Focus 3','HP Omnicept','SteamVR' , 'Meta Quest Pro','Meta No Eyetracker','Meta Quest 3','Vive/ Vive Pro, Vive Pro 2','Meta Pro Hand','Varjo','Pupil Labs', 'StarVROne','Vive Tobii','PPT HMD']


#Session Replay Headset Vizconnect to use

SESSION_REPLAY_HEADSET = 'vizconnect_config_oculus_simulate.py'

#SESSION_REPLAY_HEADSET = ['Desktop','Meta', 'SteamVR']


#Compress videos, requires moviepy library

COMPRESS_VIDEOS = True

#Types:.mp4, .avi, .mov or .mpg

VIDEO_FILE_TYPE = '.avi'

BIT_RATE = '10000k'

FPS = 30


VIDEO_RECORDING_WINDOW_HEIGHT= viz.setOption('viz.AVIRecorder.maxWidth','800')

VIDEO_RECORDING_WINDOW_WIDTH= viz.setOption('viz.AVIRecorder.maxHeight','720')


#Set starting text

STARTING_TEXT = 'Press Spacebar to Start'


#Set to true to add user instructions and change text value. For 360 and multi user version only

INSTRUCTIONS_FLAG = False

INSTRUCTION_TEXT = 'Test'


#Show Instructions on top of the gray fade Quad

INSTRUCTIONS_ON_QUAD = False


#See documentation for how to use the rating GUI. Can change also with rating.setRatingText

RATING_TEXT1 = 'How are you feeling?'

RATING_TEXT2 = 'How are you doing?'

RATING_QUESTION2 = False


CUSTOM_TRACKING_DATA = False