Free
Methods  |   March 2014
PsyPad: A platform for visual psychophysics on the iPad
Author Affiliations
Journal of Vision March 2014, Vol.14, 16. doi:https://doi.org/10.1167/14.3.16
  • Views
  • PDF
  • Share
  • Tools
    • Alerts
      ×
      This feature is available to authenticated users only.
      Sign In or Create an Account ×
    • Get Citation

      Andrew Turpin, David J. Lawson, Allison M. McKendrick; PsyPad: A platform for visual psychophysics on the iPad. Journal of Vision 2014;14(3):16. https://doi.org/10.1167/14.3.16.

      Download citation file:


      © ARVO (1962-2015); The Authors (2016-present)

      ×
  • Supplements
Abstract
Abstract
Abstract:

Abstract  This article introduces PsyPad, a customizable, open-source platform for configuring and conducting visual psychophysics experiments on iPads without the need for any code development for the iPad. Stimuli for experiments are created off-line as a library of images. The PsyPad app (obtainable from the Apple App Store) presents the images according to either built-in, customizable staircase or method of constant stimuli procedures, mapping stimuli levels to images based on the image file names. On-screen buttons for responses are configurable and matched to “correct” using the image file name of any given stimulus. All actions are logged into a text file and sent to a specified server at the end of the test if an Internet connection is available. If the iPad is not connected, the results are uploaded the next time the iPad is online. We provide a secure server for this purpose, but the server-side software is also open source if researchers choose to run their own server.

Introduction
Improvements in screen technology have allowed tablets such as the iPad to be used for visual psychophysics experiments (Dorr, Lesmes, Lu, & Bex, 2013). The portability of the devices allows suitable experiments to be conducted outside controlled laboratory settings, for example, testing schoolchildren in classrooms, patients in hospitals, or laborers on a construction site. It even opens the door for unsupervised testing, where the iPad is left in a study participant's home for regular use. Unfortunately, iPads are not designed as psychophysics research tools, with their programming requiring knowledge of Objective-C, the Apple user interface, iTunes, Xcode, and other technologies. Many psychophysics experiments, however, can be achieved using either a method of constant stimuli (MOCS) or adaptive staircase procedure on a predefined set of possible stimuli. We exploit this fact to create a customizable app (PsyPad) that allows the use of an iPad for such experiments without the need to program any software for the iPad itself. The concept is simple: All possible stimuli for the experiment are created off-line as PNG files (for example, using R, Matlab, or some other familiar system), and then the PsyPad app selects which image set to display according to customizable staircase or MOCS procedures already programmed in the app. Dynamic stimuli (movies) are treated as a sequence of still PNG images. The speed of the movie is controlled by a user-specified parameter controlling the number of milliseconds for which each image in the sequence is displayed. 
All actions on the iPad are logged into a time-stamped results file, including stimulus shown, buttons pressed, reaction time, facial features captured by the camera, and so on. This results file is uploaded to the server at the completion of a test, if the iPad is connected to the Internet, or can be uploaded later by the administrator. We provide a server at http://psypad.net.au/server, but the code for the server is open source, so it is feasible that sites could run their own server. 
A full user manual for the app is available at http://psypad.net.au. In the next section, we briefly sketch the key details of the system, and then in the Examples section we show several examples of its use. 
Methods
One test
A test in PsyPad is driven by either a customizable MOCS or staircase procedure based on image file names. Consider the example of measuring the coherence threshold for discriminating between concentric and radial global structure within Glass patterns (Glass, 1969; Wilson & Wilkinson, 1998). In this example task, the observer is required to determine, for each presentation, whether the stimulus is “radial” or “concentric” in structure. Glass patterns contain pairs of dots that are arranged as dipoles to create a particular global structure. Other dots are placed as “noise” at random, to decrease the signal coherence. The threshold measure is typically the percentage of dipoles (coherence threshold) in the signal orientation required to discriminate the global form. Hence, for our PsyPad task, the level of a stimulus is the percentage of dots that are signal dipoles. For example, in Figure 1c, 98% of dots are oriented radially, while in Figure 1b, 30% of dots are oriented concentrically. If we want to determine the coherence threshold, then we need to present images containing various levels of signal. PsyPad expects images of a given signal level to be in folders with a positive integer name, and so we will put images with x% signal in a folder named x. This is shown in the subcaptions in Figure 1
Figure 1
 
Glass patterns. (a) 0% coherence; (b) 30% coherence (concentric); (c) 98% coherence (radial). The subcaptions show the file names of the stimuli.
Figure 1
 
Glass patterns. (a) 0% coherence; (b) 30% coherence (concentric); (c) 98% coherence (radial). The subcaptions show the file names of the stimuli.
The staircase and MOCS algorithms within PsyPad operate on the integer domain, choosing a random image from the folder that is named at the signal level required. For example, the internal staircase might call for a stimulus at level 36, and so a random stimulus is taken from the folder named 36. Thus, within each folder, one can have any number of stimuli of the appropriate level which are randomly sampled. Since PsyPad's staircases work on integer signal levels, you may have to be a little creative in mapping your thresholding domain onto integer file names. For example, if you are thresholding in log units with a step size of 0.2, you might convert a stimulus level ∈ {0, 0.2, 0.4, …, 2.2} to the integer ⌊1,000 × 10−ℓ⌋, giving integer signal levels of {6, 10, 15, 25, 39, 63, 100, 158, 251, 398, 630, 1,000}. 
Responses to a stimulus are gathered with on-screen rectangular buttons whose position and size are customizable with parameters. The first two characters of the file names of the images themselves are also important: The first is the button number that would correspond to a correct answer, and the second is an underscore. Figure 1b shows the image that will elicit a correct response if button 1 is pressed, and similarly button 2 is correct in Figure 1c. Therefore, this task will have two buttons defined: button 1 labeled “Concentric” and button 2 labeled “Radial.” 
Assume, for the sake of exposition, that we have created 50 folders of Glass pattern images of varying signal level named 0, 2, 4, …,100, and each folder contains 10 concentric images, named 1_x.png, and 10 radial images, named 2_x.png, where x is a number in the range 1 … 10. These images are uploaded to the server in a single zip file. If we want to perform a MOCS to determine thresholds, we would specify the folder numbers (signal level) and the number of trials from each folder. For example, if we wanted seven levels centered on 20% coherence and 20 trials in each, we would specify “14:20, 16:20, 18:20, 20:20, 22:20, 24:20, 26:20.” PsyPad would then randomly choose from this set of folders and images, present each, and record the button pressed in the log files as a test. 
For stimuli with a temporal component, there is an extra level of subfolders in the file-naming convention. The first level is named as for static stimuli, with an integer signal level. The second is named as for the static case, but now the name is of a subfolder rather than a single image file. The third level then contains image files that are frames of the temporal stimulus, which are presented in lexicographic name order. For example, if we wanted a stimulus that had eight frames at stimulus level 40 and pressing button number 1 was a correct response, then the files could be named 40/1_x/frame1.png, 40/1_x/frame2.png, …, 40/1_x/frame8.png. The frame rate and looping behavior of the stimulus presentation are controlled by configurable PsyPad parameters. 
If we wanted to run two interleaved staircases on the same task, we would specify: 
  •  
    the number of staircases (e.g., 2);
  •  
    the start level of each (e.g., 50/20);
  •  
    the number of reversals for each (e.g., 6/6);
  •  
    the minimum stimulus level (e.g., 0/0);
  •  
    the maximum stimulus level (e.g., 100/100);
  •  
    the number of times the minimum is correct to terminate for each (e.g., 3/3);
  •  
    the number of times the maximum is not correct to terminate for each (e.g., 3/3);
  •  
    the step sizes before each reversal for each (e.g., 8,4,2,2,2,2/8,4,2,2,2,2);
  •  
    the number incorrect responses before raising the stimulus level—“up” (e.g., 1/1); and
  •  
    the number correct responses before lowering the stimulus level—“down” (e.g., 2/2).
The numbers in parentheses after each item specify an example of two interleaved, 2-down, 1-up staircases with six reversals. Note that an incorrect response causes the staircase to add the current step level to the stimulus level, and a correct response to subtract the current step level from the stimulus level, both subject to the appropriate up/down rules. 
Apart from specifying the details of the MOCS or staircase, one must also specify the appearance of the test screen. Each image is presented centered on the iPad screen. If the image has dimensions of 2048×1536 pixels, then it will fill an iPad 3 screen and overflow a iPad 2 screen (which is half the resolution). If it is smaller than the screen (advised to save memory and transfer times), then the screen is filled with a configurable background color or image. 
Response buttons for the task are placed over the image. Each button is a rectangle with customizable (x, y) location, width, height, text, text color, and background color. There can be up to four buttons. Figure 4 shows an example where the four buttons are present. It is also possible to place an Exit button, which renders as a small cross at a position, size, and color of your choosing, that will, when pressed, stop the current test and move to the next. 
There are various other configuration options for tests, such as the time between each stimulus (specified as a mean and variation for a uniform distribution), the presentation time of each stimulus, whether facial feature extraction should be attempted, and finally a fixed seed that can be specified for the random stimulus choice, allowing the same stimulus choices for different runs of the same tests. 
Multiple tests per participant
Figure 2 shows an overview of how PsyPad stores data on both the PsyPad server and iPad. Each test configuration (staircase or MOCS, as in the previous subsection) is stored as part of a participant, allowing different test configurations for different participants. Log files are stored with participants. There is a special “default” participant which can have tests configured just as for a normal participant. When a new participant is added (on either the server or iPad), it gets a copy of all the tests from the default participant. These can then be subsequently edited and customized for an individual participant. This allows ready transfer of the experimental setup to be used by multiple participants (for example, if you have a large number of people to be tested on the same experiment using the same iPad). 
Figure 2
 
Overview of the PsyPad data arrangement.
Figure 2
 
Overview of the PsyPad data arrangement.
When a participant logs onto an iPad, there are three options: 
  1.  
    Begin Tests. With this option, all tests that are “enabled” and attached to the participant are performed in the “order” that they are configured. Note that “practice” tests are not run, and that there is an option to configure a test to run only on certain days of the week. The order of tests and days of the week allowed are determined as part of test configuration.
  2.  
    Begin Practice Tests. This option works as for Begin Tests, but only test configurations that are flagged as “practice” are used. These test results are tagged “Practice” in the log files, and might be useful for genuine practice and also for participants showing off PsyPad to their friends.
  3.  
    Logout.
Server versus iPad
Images must be uploaded to the server before they can be transferred to the iPad. This is so that we can convert the images into an internal format (one large image with an index) that is much faster to transfer to the iPad. At least the default participant should also be configured on the server. Once these two are complete, it is possible to then download them to the iPad (logging in as “admin” on the PsyPad app). Once the images have made it to the iPad app, one can add participants and tests on the iPad. 
When a participant logs into the iPad, and there is a WiFi connection, the participant's test configurations are automatically downloaded from the server. This allows remote management of test configurations. However, it also creates the potential for any changes to configurations made on the iPad and not uploaded to the server to be overwritten. We acknowledge that this has the potential to be annoying, but we reasoned that remote management of configurations without requiring involvement of the participant will be more convenient and useful than mistakes made by altering configurations and forgetting to upload them. For this reason, we recommend that all configuration editing take place on the server. 
Log files
All actions are logged in a file that is uploaded to the specified server as soon as a test is complete, if there is a WiFi connection for the iPad, or when the “admin” user chooses “Upload Logs.” The raw text of log files is readable on the iPad, and there is also a summary interface on the iPad that provides bar graphs of the average reaction time for each stimulus level, the number of presentations made at each stimulus level, the value of each reversal in each staircase (if a staircase was used), and the number correct at each stimulus level. The server at http://psypad.net.au/server also has a summary pane for each log file that displays the number correct at each stimulus level (MOCS) or reversal (staircase). 
While these interfaces give a quick snapshot of a log file, the system is designed so that the log files will be processed off-line by analysis scripts written by PsyPad users. 
Examples
In this section we give several examples of how PsyPad could be used. Of course, the possible uses are limited only by your imagination. 
Glass pattern thresholds
As introduced in the Methods section, PsyPad can be used for thresholding tasks like determining Glass pattern thresholds. Using stimuli as in Figure 1 and two interleaved staircases results in output such as in Figure 3. Figure 3 shows a portion of the raw log file and a summary of a single test as it appears on the PsyPad server. Movie 1 shows a short MOCS demonstration of the Glass pattern task. 
Figure 3
 
An example log file for a staircase procedure (left) and a summary of that log file (right).
Figure 3
 
An example log file for a staircase procedure (left) and a summary of that log file (right).
Global dot motion
Another task that has shown to be robust to contrast and viewing distance is the detection of global dot motion (GDM) thresholds (Edwards & Badcock, 1994; McKendrick, Badcock, & Morgan, 2005). An example version of this task may include stimuli consisting of eight frames containing 100 dots, some percentage of which move in the signal direction between each frame. The task is two-alternate forced choice to choose the direction of motion, and thus the PsyPad configuration has two response buttons: “left” and “right.” We have successfully collected GDM thresholds with PsyPad in our lab. Movie 2 shows a short MOCS demonstration of the global dot motion task. 
Survey questions
Rather than constructing visual stimuli, a test in PsyPad can also be configured to ask survey questions with up to four (exclusive) response buttons. The method is simply to make the question an image and present it as a single-presentation MOCS. This might be useful if you want to gather information about a participant at the beginning of a session of tests. Figure 4 shows one example, where the stimulus is the image containing the text “How many hours did you sleep last night?” and the buttons are configured accordingly. The response is logged just as for any other PsyPad test. Movie 3 shows a full session that captures the answer to Figure 4
Figure 4
 
An example of a survey question with four responses that could be used in PsyPad.
Figure 4
 
An example of a survey question with four responses that could be used in PsyPad.
Gamma correction and calibration
One final set of images with which we have experimented are images that contain all one pixel value (with the pixel value given in text in the top left of the image). By configuring a test with these images in a staircase, naming all of the image files beginning with “1_,” and always pressing button 1, you get a sequential presentation of a uniform screen at various pixel levels. It is then possible to use a photometer to measure the screen luminance for the pixel levels on multiple iPads to check for between-device differences and possible gamma correction that might be required for some experimental designs. We have used this approach to assess five different iPad 3s (retina display) and found no difference in luminance, no change in luminance over a 30-min warm-up period, and a consistent relationship between named pixel value and measured luminance output. Figure 5 shows the luminance values for each pixel level measured for the 5 iPads when first turned on and again at 30 min. Note: If required, any compensation for the nonlinear relationship between pixel value and luminance output needs to be applied within the image file generation prior to uploading to PsyPad. 
Figure 5
 
The luminance of the center of five different iPad 3s while showing images of one pixel value at some time and then again 30 min later.
Figure 5
 
The luminance of the center of five different iPad 3s while showing images of one pixel value at some time and then again 30 min later.
Discussion
Obviously, conducting psychophysics experiments on an iPad has limitations. If the test is unsupervised, then lighting conditions, viewing distance, screen brightness, and so on are difficult to control. PsyPad sets the iPad brightness to maximum before the beginning of a test, but does not have access (currently) to disable the Auto-Brightness feature, which, if activated, may alter the luminance of the device. Similarly, there is no ready access to timing in the display hardware, and so precise control of temporal stimuli is lacking. These are simply limitations of the iPad, and so experiments that require precise control of these features will probably not work well using PsyPad. Indeed, if one intends to use PsyPad in situations where precise luminance, reaction timing, or stimuli timing is required, a careful calibration study should be performed prior to experimentation, just as with all psychophysics equipment. 
It is perhaps feasible to control viewing distance by computing the interpupillary distance of a participant as it appears in images captured by the onboard camera. While this initial release of PsyPad does include face capture and, using iOS's Core Image library, attempts to find the two eyes and the mouth of the face, these are simply logged and not used in calculations. If resources are available, we will pursue it in future releases. In our experience, participants view the iPad at an angle, not “face-on,” and so detection of facial features is usually not possible. 
Using portable testing devices outside the laboratory may create privacy challenges that are not present in the lab. Test logs are stored on the iPad, which may be used by people other than the test participant, but are only accessible with the PsyPad administrator account password (which can be changed on every device). Even if this password were compromised, in most situations it is unlikely that staircase or MOCS data for a visual psychophysics task are particularly sensitive; still, this should be taken into account when considering human-research ethics requirements for PsyPad experiments. Test logs are also sent to a server, which is again password protected. Data transmitted across wireless and wired networks can be intercepted by determined attack, and so this is another privacy consideration. Using participant identifiers that cannot be connected with the participant's true identity would decrease the chances of such an attack's leading to a breach of participants' privacy. Often these risks are also present in a lab setting, and so they should not deter use of PsyPad. 
There are several iPad apps available for specific psychophysical tasks. For example, RFspotter (Cottaris, 2012) maps receptive fields; and contrast sensitivity functions can be measured with the app by Dorr et al. (2013). These apps allow thresholding algorithms other than MOCS or staircase to be used for their specific tasks, but they do not allow experimenter-defined image stimuli as in PsyPad. PsychToolbox currently has experimental support for Google Nexus 7 tablets when they are running under Ubuntu Linux 13.04, 32-bit ARM edition (PsychToolbox, 2013). Mulligan (2012, 2013) is in the process of porting QuIP to the iPad as an app, which would allow scripting in the QuIP language to produce stimuli and undertake psychophysical tasks. 
In summary, we have attempted to make a system that allows visual psychophysics research to be undertaken using iPads without the need to actually program the iPad itself. Any experiments that use a MOCS or staircase thresholding procedure, and whose stimuli can be precomputed as images or movies, can be achieved using PsyPad. We have made the system open source, and set up a wiki at http://psypad.net.au to encourage development of a PsyPad user community. The app itself can be downloaded from the Apple App Store. 
Supplementary Materials
Acknowledgments
Thanks to David Badcock for helpful discussions about this project. This work was supported by the Australian Research Council (AT FT0991326, AMM FT0990930). 
Commercial relationships: none. 
Corresponding author: Andrew Turpin. 
Email: aturpin@unimelb.edu.au. 
Address: Department of Computing and Information Systems, University of Melbourne, Melbourne, Australia. 
References
Dorr M. Lesmes L. Lu Z. Bex P. (2013). Rapid and reliable assessment of the contrast sensitivity function on an iPad. Investigative Ophthalmology and Visual Science, 54, 7266–7273, http://www.iovs.org/content/54/12/7266. [PubMed] [Article] [CrossRef] [PubMed]
Edwards M. Badcock D. (1994). Global motion perception: Interaction of on and off pathways. Vision Research, 34, 2849–2858. [CrossRef] [PubMed]
Glass L. (1969). The moire effect from random dots. Nature, 223, 578–580. [CrossRef] [PubMed]
McKendrick A. Badcock D. Morgan W. (2005). The detection of both global motion and global form is disrupted in glaucoma. Investigative Ophthalmology and Visual Science, 46, 3693–3701, http://www.iovs.org/content/46/10/3693. [PubMed] [Article] [CrossRef] [PubMed]
Mulligan J. (2012). A GPU-accelerated software eye tracking system. In Spencer S. N. ( Ed.), Proceedings of the Symposium on Eye Tracking Research and Applications (ETRA '12) ( pp. 265–268). New York: ACM.
Mulligan J. (2013). Rapid assessment of contrast sensitivity with mobile touch-screens. Journal of Vision, 13 (9), 270, http://www.journalofvision.org/content/13/9/270, doi:10.1167/13.9.270. [Abstract] [CrossRef]
PsychToolbox. 2013. Psychtoolbox-3 Latest News, PTB release 2013-4. Available at http://psychtoolbox.org/PsychtoolboxNews.
Wilson H. Wilkinson F. (1998). Detection of global structure in Glass patterns: Implications for form vision. Vision Research, 38, 2933–2947. [CrossRef] [PubMed]
Figure 1
 
Glass patterns. (a) 0% coherence; (b) 30% coherence (concentric); (c) 98% coherence (radial). The subcaptions show the file names of the stimuli.
Figure 1
 
Glass patterns. (a) 0% coherence; (b) 30% coherence (concentric); (c) 98% coherence (radial). The subcaptions show the file names of the stimuli.
Figure 2
 
Overview of the PsyPad data arrangement.
Figure 2
 
Overview of the PsyPad data arrangement.
Figure 3
 
An example log file for a staircase procedure (left) and a summary of that log file (right).
Figure 3
 
An example log file for a staircase procedure (left) and a summary of that log file (right).
Figure 4
 
An example of a survey question with four responses that could be used in PsyPad.
Figure 4
 
An example of a survey question with four responses that could be used in PsyPad.
Figure 5
 
The luminance of the center of five different iPad 3s while showing images of one pixel value at some time and then again 30 min later.
Figure 5
 
The luminance of the center of five different iPad 3s while showing images of one pixel value at some time and then again 30 min later.
×
×

This PDF is available to Subscribers Only

Sign in or purchase a subscription to access this content. ×

You must be signed into an individual account to use this feature.

×