#create the log file
now = datetime.datetime.now()
logFilename = "IAPS_SemanticRating_subject%03i_%i-%i-%i.csv" % (subjectID, now.month, now.day, now.year)

# determine the filename for the visual angle measurements
visualAngleFilename = RATING_VISUAL_ANGLE_FILENAME % (subjectID)

# TODO - instructions
instructions = '.'

# use this function to initialize vision egg, open the log file,
# read in the input files and display the instructions
experiment.quickInit(logFilename, \
		     RATINGS_STIM_FILENAME, \
		     RATINGS_FILELIST_FILENAME, \
		     visualAngleFilename, \
		     instructions)

########################################
# Add Experiment Handlers              #
########################################

############### Key Handlers ####################

# add a handler that will display the text that the user types
# in the bottom of the screen
experiment.addKeyHandler(TextEntryKeyHandler(experiment))

################## Null Stim Handlers ################
	stimFilename = PRACTICE_EST_STIM_FILENAME % (practiceRun)
	imagesFilename = PRACTICE_EST_FILELIST_FILENAME % (practiceRun)

# determine the filename for the visual angle measurements
visualAngleFilename = PRACTICE_VISUAL_ANGLE_FILENAME % (subjectID)

# show instructions
instructionsText = ''
if validationRun:
	instructionsText = 'In this experiment you will see a series of images that repeat multiple times. There will be a white fixation cross (+) located in the center of the screen. We ask that you maintain focus on the cross at all times. \n\n Your task is to judge whether they are negative, neutral or positive. For negative press the leftmost button with your index finger, for neutral the second button with your middle finger, and for positive the third button with your ring finger. Categorize each image as quickly as you can. Since you will see multiple presentations of eaceh image, it is ok if you change your rating for successive viewings.\n\nPlease let your experimenter know when you are ready to continue...'
else:
 	instructionsText = 'In this experiment you will see a series of images. There will be a white fixation cross (+) located in the center of the screen. We ask that you maintain focus on the cross at all times. \n\n Your task is to judge whether they are negative, neutral or positive. For negative press the leftmost button with your index finger, for neutral the second button with your middle finger, and for positive the third button with your ring finger. Categorize each image as quickly as you can.\n\nPlease let your experimenter know when you are ready to continue...'

# use this function to initialize vision egg, open the log file,
# read in the input files and display the instructions
experiment.quickInit(logFilename, stimFilename, imagesFilename, visualAngleFilename, instructionsText)

########################################
# Add all Experiment handlers          #
########################################

# add a time handler which will turn the stimulus off after 1 second
experiment.addTimeHandler(StimOffTimeHandler(experiment,offTime=1))

# add a handler that will record the inputs from the scanner's 4 Button response box
experiment.addKeyHandler(Scanner4ButtonKeyHandler(experiment))

# tell the experiment that a trial ends after 4 seconds
experiment.setTrialFinishedHandler(TimeTrialFinishedHandler(experiment,seconds=4.0))

########################################
Example #3
0
######################################

#create the log file
now = datetime.datetime.now()
logFilename = "IAPS_SemanticMask_subject%03i_%i-%i-%i.csv" % (subjectID, now.month, now.day, now.year)

# TODO - Make a unique filename
# determine the filename for the visual angle measurements
visualAngleFilename = RATING_VISUAL_ANGLE_FILENAME % (subjectID)

instructions = ''
# use the experiment to load the input files

# use this function to initialize vision egg, open the log file,
# read in the input files and display the instructions
experiment.quickInit(logFilename, MASKS_STIM_FILENAME, MASKS_FILELIST_FILENAME, visualAngleFilename, instructions)

########################################
# Add Experiment Handlers              #
########################################

# add a time handler which will turn the stimulus off after the number of
# frames specified in the stimParams file
experiment.addTimeHandler(StimOffTimeHandler(experiment,offFrame=1,useStimParams=True))

# this handler will display the masks given in the file referenced below
# in the order and number specified in the stimParams file
masksPath = os.path.join(MASKS_PATH, MASKS_FILES_FILENAME)
experiment.addTimeHandler(ShowMasksTimeHandler(experiment,masksPath))

############### Key Handlers ####################