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 ################

# tell the experiment to give the user a break every time it encounters a null stim
experiment.addNullStimHandler(BreakNullStimHandler(experiment))

################# Trial Finished Handler #################

# set the TrialFinished handler to finish when a response is made
# in this case it's when the user has entered a sentence in TextEntryKeyHandler
experiment.setTrialFinishedHandler(ResponseTrialFinishedHandler(experiment, count=1))

########################################
# Start the Experiment Loop            #
########################################

# finally, start the experiment loop which will display
# all the stimuli using the handlers crated above
experiment.runExperiment()
예제 #2
0
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))

########################################
# Start the Experiment Loop            #
########################################

# finally, start the experiment loop which will display
# all the stimuli using the handlers crated above
experiment.runExperiment()
예제 #3
0
########################################

experiment.waitForScanner()

########################################
# Add 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 two TTL pulses
experiment.setTrialFinishedHandler(TTLTrialFinishedHandler(experiment,ttlTotal=2))

########################################
# Start the Experiment Loop            #
########################################

# finally, start the experiment loop which will display
# all the stimuli using the handlers crated above
experiment.runExperiment()

########################################
# Wait end Dummies       	       #
########################################

# wait for another 5 dummies (10  seconds) to let HRF settle down
experiment.waitDummies(5)