NECSUS code - collaboration between Maastricht and Coimbra
This repo contains the code for the stimuli of the NECSUS project.
Brief description of the folder structure.
contrast detection stimulus with glare frame (distractor) embedded.
Dependencies:
- PTB3 (http://psychtoolbox.org/)
Script that calls the stim and sets the required variables. It identifies the participant (names/IDs according to the NECSUS naming procedures - see SOP_Data_Acquisition). Each section represents the definition of specific properties of the paradigm: Stim presets (run, participant, study, display, gabor, frame).
IMPORTANT NOTES (site specific):
- The stimulus is defined based on visual angles that depend on: VIEWINGDISTANCE
- The stimulus is presented on a specific display - confirm variable ptb.screenNumber
- contrast detection should be determined on a screen with gamma function correction that varies for each display- our gamma function is located here pathToGreyData
glare dimensions (frame, dot size, etc.) are defined in visual angles (degrees). The blinking dots are randomly defined (seed of the random generator) in funtion glareInfo().
- designGlare() setup the embedded glare frame. Convert visual angles to pixels etc.
- screenGlare() Prepares frame for flip() with or without blinking dots.
Gabor patch dimensions (size in visual angle degrees, etc.), phase, frequency in funtion gaborInfo().
luminanceToRgb() - Using max luminance from the display, get the 20 c/m2 value normalized assuming linear CLUT (linInput).
runStim_UM - main function that displays the contrast and glare, calls the contrast update algorithm etc. stimulusDefinition_UM - Set the default values for the variables selected for this run (related with gabor patch properties).
IMPORTANT NOTES (site specific):
- The stimuli is adjusted to a specific display. To this end, this function requires the original luminance measurements (particularly the maximum luminance) and the linearized gamma corrected table. In our example, the luminance measured is saved in variable 'NecsusNolightGray-rgblum11-Dec-2018.mat' and the gamma corrected table (normalized) is saved in 'InvertedCLUT.mat' - both .mat files are in the "luminance" folder.
- stimulusDefinition_UM defines the keys to be pressed according to the participant perception of the stimuli.
Helper functions - misc. parameters, etc..
- designFixationCross() - init parameters of fixation cross (size in pixels)