Contrast Sensitivity: Lesson 2

In this lesson, you will learn how to:

- duplicate an experiment,
- set experimental conditions through the Conditions method,
- move the events using drag and drop,
- fit a model to the measurements.

This lesson assumes you have been through Lesson 1 of this tutorial and became familiar with adding and inspecting the various types of events.

Difficulty: 2/5
Duration: 30 mn

EFFECT OF SPATIAL FREQUENCY

In Lesson 1, you learned how to create a basic experiment to measure contrast threshold for a single spatial frequency. This lesson makes the basic contrast sensitivity task more elaborate by measuring the effect of the Gabor stimuli's spatial frequency. The measurements will be made through interleaved staircase methods, each of them specifying one experimental condition (spatial frequency).

Step 1: Duplicating the Experiment

From the Designer panel, select the Contrast Sensitivity experiment designed in Lesson 1, and press the -D keystroke (or select Duplicate from the Edit menu). The duplicate appears at the top level of the table with the 'copy' suffix added to the name of the original event. Rename the copy as Contrast Sensitivity 2.

The above message appears when changing the name of an experiment which ID already exists in the session database. Since we are working on a copy, click the No button to automatically create a new ID for this new experiment.

Tip: There are alternative ways to duplicate an event:
- Using the regular Copy/Paste with the -C & -V keystrokes; events copied this way are always pasted in the Storage area of the table.
- Use -D to duplicate the selected event at the top of the Designer table.
- Option-drag an event to make a copy at the dragged position.

Step 2: Adding and Customizing a "Conditions" Event

Select the Contrast Sensitivity 2 experiment, reveal its hierarchy, and insert a new group event using the '+' folder icon. Select the Conditions sub-category Method and simply rename the new event Conditions.

Select the new event named Conditions, and click on the Inspector button to inspect and modify its properties:

1) Click on the Conditions tab to select this Method sub-category if not yet specified.

2) Click on the '+' button above the Conditions table to add a new condition (called unnamed condition by default).

3) Rename it as Effect of Spatial Frequency.

Make sure to select this new condition, and click on the '+' button above the Variables table to add a new variable (called unnamed variable by default). Rename this variable as sf (for spatial frequency).

Make sure to select this new variable, and click on the '+' button above the Values table to add a new value (called unnamed value by default). Set this value to 0.5. Leave the number of trials as 1.

Add additional values for the sf variable, for example: 1, 2, 4, 8, and 16 (spatial frequency is typically expressed in cycle per degree).

Here we have defined six experimental conditions: the sf variable is the independent variable of this experimental design which will take one of the six values in each trial. The number of trials for each value was left as 1 because the actual number of trials will depend on how fast the adaptive method (staircase) can estimate the threshold.

Finally make sure to select the randomized option for Trial order inside a condition to ensure the different spatial frequency sub-conditions will be presented in a random order rather than in the specified order.

Click on the OK button to validate the changes and return to the Designer panel.

Step 3: Updating the Hierarchy and the Stimulus Properties

Click on and drag the Staircase event INTO the Conditions event so it gets indented to the right as illustrated. This way a staircase will run for each experimental condition defined above (i.e. one staircase for each spatial frequency), and the 6 different staircases will be presented randomly interleaved.

Option-click on the arrow in front of the Staircase event to reveal the entire hierarchy down to the Gabor Stimulus event.

Select the Gabor event and edit its properties by clicking on the Inspect button (or press -i).

Finally, connect the sf variable, defined in the Conditions event, to the spatial frequency parameter of the stimulus (select and control-click on the text field content and choose the appropriate variable in the contextual menu). Note that the orientation variable has been already connected to the stimulus orientation in Lesson 1.

If you wish to preview the stimulus with realistic values for its parameters, just add a colon (:) after the variable name followed by a value, all between brackets as illustrated. As already noted in the previous tutorial, these values are used only for preview purposes and have no effect on the experimental design or during its execution.

Click on the OK button to validate the changes and return to the Designer panel.

Check & run the Experiment! It may take 8 to 10 minutes to collect the data and derive estimates of the contrast threshold for the 6 experimental conditions.

Remember: To save the session results in the results database for future retrieval, always make sure to:

- run the experiment in full-screen mode by toggling the display icon in the Designer bottom toolbar,
- select the subject and group in the Session Information panel,
- click on the Run Session button in the Session Information panel.

Step 4: Visualizing the Results Summary

Upon termination of an experimental session, the results data can be visualized immediately from the Plotter panel:

1) Click on the Plotter icon in the toolbar to access the panel. The results for the last session appear at the top of the table.

2) To visualize a summary of the results, select the root object of the session entry: Psykinematix automatically detects that the measurement (threshold estimate) was collected as function of the spatial frequency (variable sf), and plots the associated graph.

3) You can customize the appearance of the graph by clicking the "Graph Settings" button to access the Graph Properties palette (4) or the "Data Settings" button to access the Data Analysis palette (see Step 5).

4) In this example, the title of both axes was renamed, their scale changed to logarithmic, and their range and number of ticks ajusted for best appearance.

5) Control-click inside the graph to print, copy, or save it to a file.

6) Click on the Data Table button to reveal the spreadsheets containing the results summary.

This dataset under the Contrast tab contains the contrast threshold measured by the staircase method for each experimental condition. Each line refers to a condition, and each column presents the values for each relevant information:

- Condition: the name of the condition. Here a single condition was declared in the Conditions event (see Step 2 above).

- Variables: the independent variables associated with the condition and their values (spatial frequency variable sf). Several variables could be indicated in this column (see for example Lesson 2 of the Orientation Discrimination tutorial).

- Mean and Std: the mean and standard deviation for the threshold estimate measured by the staircase. The unit is the same as for the initial contrast value indicated in the Staircase event (see Step 6 in Lesson 1).

Control-click inside the spreadsheet to print or export this summary data in various formats.

Step 5: Fitting a Model to the Measurements

While you could export the data to some 3rd-party software to fit the data with a contrast sensitivity function (CSF) and derive some important parameters like peak frequency, cut-off frequency, bandwidth, etc, you may also use the advanced fitting capabilities provided by Psykinematix:

1) Select the Results tab in the analysis section on the right side of the results table (click the "Data Settings" button on the right of the "Graph Settings" button to reveal the Data Analysis palette).

2) Indicate how the data should be fitted with a function y = F(x): select CSF for Fit, sf for x, Mean for y, Std for ±σ to fit the built-in CSF function (Contrast Sensitivity Function) to the contrast threshold estimate (Mean) as function of spatial frequency (sf) taking into account the standard deviation of the estimate (Std) as a weighting factor.

The results of the fitting procedure is immediately displayed on the graph with the original measured data (mean ± standard deviation) shown as indivual points (red filled square symbols) and the fitting curve as a plain line. Some estimates of the free parameters (a, b, c) of the fitting function are also added on the graph along with the estimate of some descriptive parameters (e.g. peak, which depends on the free parameters) and information relative to the goodness of the fit (RMSE, root-mean-square error, and df, degree of freedom).

Note that the details of the built-in CSF function are provided in the Y(y) and F(x) text fields: Y(y) indicates that the reciprocal of the threshold (1/Mean) is actually fitted with the function provided by F(x). F(x) describes a simple model of the CSF with 3 free parameters (a, b, c) constrained to some ranges and with a descriptive parameter (peak = 1/c-a/b). Of course you can also provide your own custom model to fit the data if needed. For more details, see the "Fitting Models to Measurements" section of the "Data Fitting" chapter of the documentation.

Generally, there is no need to inspect further the results produced during the session. However, in case of doubts regarding the data reliability it is possible to review the dataset for each experimental condition as illustrated in the next step.

Step 6: Inspecting the Results for each Condition

1) Click on the small arrow in front of the session entry to expand its second hierarchy level. You are presented with the method (Staircase) and procedure (Vertical/Horizontal Discrimination) components of the results for each experimental condition: the first column indicates which method or procedure event produced the dataset, the second column indicates the condition, and the third column indicates the values of the independent parameters for this condition.

2) Selecting any Staircase entry updates the spreadsheet (revealed by clicking on the "Data Table" button) with the method parameters or variables for each trial run for the condition: the trial index, the number of reversals, the parameter rate and the value of the dependent variable (contrast Threshold).

3) Click on the small arrow in front of the Staircase entry to expand the third hierarchy level. You are presented with the individual parameters or variables for the method.

4) Select one of these entries to graph its attached dataset and update the spreadsheet with the trial history for the selected parameter or variable. Control-click inside the table or inside the graph to print, copy, or save it to a file.

5) As before, you can customize the appearance of the graph by clicking the "Graph Settings" button to access the Graph Properties palette or the "Data Settings" button to access the Data Analysis palette.

See the Importing, Plotting, Fitting, and Exporting Data tutorial to learn more about the Plotter panel.

Conclusion

In this lesson, you learned how to duplicate an experiment, specify experimental conditions through a Conditions method, and move the events using drag and drop. You also learned how to inspect each level of the results hierarchy and fit a model to the measurements. Most important, you learned in Lessons 1 and 2 how to create a complete experiment to measure contrast sensitivity, one of the most fundamental properties of the visual system.

If you wish to expand this experiment by adding temporal masking or spatial context to the stimulus, or by using dynamic stimuli, you should consider the following lessons of the Orientation Discrimination tutorial to learn how to:

- implement a sandwich paradigm with forward and feedback masking noise (Lesson 3),
- add a spatial and temporal context (Lesson 4),
- add motion & dynamics through the use of a 1st-order drifting Gabor (Lesson 5).

Back to Tutorials

© 2006-2024 KyberVision Japan LLC. All rights reserved.