OASIS software and its application in experimental handwriting research.

Published as: W.P. de Jong, W. Hulstijn, B.J.M. Kosterman, & B.C.M. Smits-Engelsman (1996). OASIS software and its application in experimental handwriting research. In: M.L. Simner, C.G. Leedham, A.J.W.M. Thomassen (Eds). Handwriting and Drawing Research: Basic and Applied Issues. Amsterdam: IOS.

Authors:
W.P. de Jong
W. Hulstijn
B.J.M. Kosterman
B.C.M. Smits-Engelsman

Department of Experimental Psychology, University of Nijmegen, (NICI)
PO Box 9104, 6500 HE, The Netherlands.

Abstract

OASIS is a flexible and complete software tool for the experimental research of handwriting and drawing. The basic idea behind OASIS is that a coherent special-purpose macro language can reduce the time needed to conduct an experiment considerably. This article is aimed at those who want to use a digitizer in their research but lack the appropriate software to do so. It will review some of the tools that are present in OASIS, shows one experiment that was done, and discusses the creation of two simple macros for OASIS.



[photo: experimental setup]
Figure 1: B.J.M. Kosterman (left) tests a subject (right) on the Fitts task.


1. Introduction

Writing and drawing tasks are widely used in psychological and psycho-motor tests and for the investigation of human motor control (Van Galen, et al., 1992; Smits-Engelsman, et al., 1994; Thomassen, et al. 1994). Electronic writing tablets, when connected to a computer, are able to record the writing and drawing movements with great precision. OASIS is a software package that was designed to implement and execute, testing procedures and experiments that use such a digitizer. The main purpose of OASIS is not to provide the experimenter with a fixed set of ready-to-run tests and experiments, but rather, to provide the necessary tools to create new ones. These tools are designed for experimenters who are interested in, recording, storing, and analyzing, movement trajectories made with a pen on a digitizer in response to stimulus and feedback given by a computer. Although all the separate elements of OASIS are not unique, their combination into one coherent software tool is. The aim of this article is to inform other researchers in the area of motor control about the existence of OASIS and its possible applications. This article will therefore describe the ideas behind the development of OASIS, discuss an experiment done in OASIS, and elaborate on the implementation of two simple macros.


2. Ideas behind OASIS

At the Nijmegen Institute of Cognition and Information (NICI) a considerable number of articles has been written that report on experiments in which a digitizer was used. For every new experiment that was conducted, old software was adapted, or new software was written. Most of the time new routines needed to be written for the control of the digitizer, the presentation of stimuli, the saving and retrieving of the data, and for the analysis. Clearly there was no uniformity in this software. Every new experiment required therefore a lot of (re)programming time. OASIS is the result of the quest inside NICI for a simple and flexible software package which reduces the time needed to design and implement a new experiment. The acronym OASIS stands for Optimized Action Sequence Interpreter System. This name refers to the macro language that is used to control the actions performed by OASIS. In this section we will discuss this macro language, the user-interface, the interactivity of the digitizer, and some of the special purpose actions and variables of OASIS.

2.1 The macro language

The main purpose of OASIS is to simplify and shorten the process of implementing, conducting, and analyzing the results of an experiment or test. This objective is achieved by providing an abstract programming environment which detaches the user from the intricacies of programming at a low level. Within this abstract environment the experimenter can perform a multitude of simple and complex actions. The basis of this abstract environment is formed by a software library that was especially designed for this purpose. The flexible macro language provides the experimenter with a coherent and reliable platform to conduct tests and experiments.
An OASIS macro is a plain text file, basically, consisting of pools of droplets. A pool starts with a '(' and ends with a ')'. All the droplets of a pool are written between these two parentheses and the individual droplets are always separated by spaces. Two pools of two droplets would, for instance, look like:

(Droplet1 Droplet2)(Droplet3 Droplet4)

Pools can also be nested. A pool with two droplets of which the second droplet is again a pool of two droplets would look like:

(Droplet1 (Droplet2 Droplet3))

A droplet can be one of many things, it can be a number, a switch, a piece of text, an action, a variable, a complex, or it can, as is already shown, be a pool of droplets. A switch is a droplet that has only two states, like a computer bit, it can be switched ON or OFF. An action is the basic tool to get a macro to do something. Some actions consists of a single droplet, others consist of a pool with one or more droplets following the action droplet. The meaning of the successor droplets depends entirely on the action. The action droplet for adding numbers, for example, is called '+'. When the pool (+ 3.55 4.3 9.9) is evaluated, it will result in the number droplet 17.75. All other actions work in an analog fashion. A variable is a reference to another droplet. Variables can be used to store droplets of any type. A variable can also refer to a complex droplet. A complex is a compound droplet like a file, a signal, or a part of the display. Complexes can only be created during the execution of a OASIS macro. The macro language also possesses all the control structures of a modern high-level programming language. The following macro produces, for instance, a sequence of five beeps with a random pitch by using the 'LOOP' action:

(SET Counter 0)                     {set counter variable to zero}
(LOOP                               {repeat the next droplets}
  (Beep (Random 20 20000) 0.3)      {beep 0.3 secs., random freq.}
  (Wait 0.3)                        {wait 0.3 secs.}
  (INC Counter)                     {increase counter by one}
  (IF (= Counter 5) BREAK)          {leave loop after five beeps}
)

This simple example uses basic actions like waiting and handling variables, but clearly this could be achieved as easily in any other programming language. The main advantage of OASIS over these general-purpose languages is therefore formed by the special-purpose actions. An action like (SetSystemMarkers PenV) would, for instance, put markers at all the maxima and minima in the absolute velocity signal of the pen tip trajectory. It is obvious that using this single action requires less programming time and will produce a more consistent result over different experiments.



[screen dump: stop requester]

[screen dump: stop requester]
Figure 2: A window with two gadgets.
Top panel in the text mode and bottom panel in graphics mode.



2.2 The Dual-Mode User-Interface

OASIS is written for Microsoft DOS and therefore supports its own user interface system. This Dual-Mode User-Interface (DMUI) is called 'Dual-Mode' because it can be operated with the same commands in the text as well as the graphical display modes of a PC. The most important elements of this DMUI are windows and gadgets. Gadgets are little interfaces through which the user can enter certain commands into OASIS. Gadgets are always placed inside windows, which form the base from which they operate. The window that is shown in Figure 2, for instance, uses two gadgets. There is one gadget for confirming the request and another for denying it. All gadgets in OASIS can react to mouse, pen, and keyboard actions. The user could for instance confirm the request by pushing the left mouse button or pressing with the pen on the digitizer when the pointer is over the 'Yes' gadget. Another way to confirm this requester is by pushing the 'Y' key on the keyboard. Most of the time the experimenter does not have to program the DMUI directly; it is simply there. The windows and the gadgets shown in Figure 2 are, for instance, generated by this single action:

StopRequest           {ask the user whether or not to stop the macro}

Many other, and more complex, requesters are available (see for instance Figure 4). The DMUI used in OASIS will enhance the interactions with the subject without the need for a lot of source code.

2.3 Interactivity of the digitizer

Another basic ideas behind the OASIS software is that it should be able to interact with the person that is writing, or drawing, on a real-time basis without the need for an extra mouse or keyboard. In OASIS there is, therefore, no clear distinction between recording and analyzing a pen-tip trajectory. It is possible to do both at the same time and to use the result of the on-line analysis in an adaptive manner. A very simple example is the real-time feedback of the pen position on the computer screen. But this feedback can, as easily, be turned upside down, skewed, or be replaced by many other types of feedback. A more complex example of interactivity would be to let the writer start and stop the recording of the pen movements by specifying the conditions at which this should occur. The example presented in Paragraph 3.1 uses this type interactivity.



[Screen dump: Word-Perfect Graphics]
Figure 3: Somebody wrote 'Demonstration'. Note that the thickness of the lines corresponds to the axial pen pressure (this is a screen dump which cannot show the high resolution of a WPG file).


2.4 Special purpose actions and variables

Many special purpose actions are present in OASIS which are not present in other programming languages. There are, for instance, actions for storing, retrieving, handling, and analyzing, digitizer data. One example of those actions is CreateNewPenFile. It creates a pen file complex which can be used to store and retrieve records of digitizer data in and from with simple actions like and WritePenRecord and ReadPenRecord. OASIS uses a special loss-less compression method to reduce the resulting file sizes to a minimum. Before you can retrieve a record from a pen file, a pen space should be created, with the CreatePenSpace action, to buffer the samples that are contained in a pen record. There is no real limit to the amount of samples that can be stored in such a pen space. Each such a sample is a kind of snapshot of the state of the pen taken at regular intervals. There are twenty-four predefined pen variables through which all the parameters of such a pen sample can be accessed. The pen variable which should be checked before accessing the other pen variables is PenValid, because it indicates whether or not the values contained in the other pen variables are valid or not. The PenDown variable indicates whether or not the pen is down on the digitizer. This variable is equivalent to the pool:

(> PenZ 0.0)            {only true when PenZ is bigger than zero}

where PenZ contains the current axial pen pressure in grams. Pen pressure is also measured perpendicular to the digitizer and can be accessed through the PenNormZ variable. The PenT variable returns the exact time at which the sample was recorded and the PenDT contains the time that elapsed since the previous sample. The PenX and PenY variables refer to the position of the pen on the two perpendicular axes of the digitizer. There are several pen variables with which pen tip velocity can be accessed. The most important one is PenV; it represents the current velocity of the pen tip independent of the direction in which the pen is moving. The PenVX and PenVY reflect the velocity of the pen tip along the two perpendicular axes. The PenAbsVX and PenAbsVY variables return the absolute values of the PenVX and PenVY. All the pen tip velocity variables are filtered, in real-time, by median filters. These special-purpose filters select the median out of a selected window of raw velocity values surrounding the current pen sample. The filters will remove erratic velocity fluctuations, which are caused by the hardware, from the velocity signals. There are five variables which will return angles. Three of them indicate the tilt of the pen, ,PenTilt, PenTiltX, and PenTiltY, which represent absolute tilt and the tilt along one of the two perpendicular axes respectively. One of them, PenDir, reflects the directions in which the pen is moving and another, PenAngle, contains the direction in which, when seen from above, the pen is pointing. Furthermore, there are two sets of pen variables that reflect the distance that the pen tip has covered since the start of the recording. The first set is called the distance set and the second set is called the radial set. The distance set returns the absolute distance, from valid sample to valid sample, covered by the pen tip. PenD will return the total distance covered independent of movement direction. PenDX and PenDY will return the absolute distances covered over the horizontal and vertical axis. The radial set return the current radial distance from the origin of the digitizer. PenR will return the absolute radial distance from the origin and PenRX and PenRY will return the horizontal and vertical radial distances from the origin. All these twenty-four variables are updated by a simple action called NextPenSample. There also exists a action called PreviousPenSample which allows a macro to update the sample variables backwards in time. The variables can also be used in graphical representations of the pen space. The plot action:

(PlotPenSpace "DEMO.WPG" 'PenX 'PenY 'PenZ)

could, for instance, have produced Figure 3. Note that the last three droplets in this pool indicate which variables should be used for the horizontal, vertical axes, and the thickness of the line, in the plot. These variables can be replaced by any of the other pen variables. After a pen tip trajectory has been recorded it can be divided into many small sections. These sections, normally called segments, can be named and can be used in the analysis of the pen samples. There are three ways to obtain segments. First of all, the standard system segments could be used. These segments reflect the strokes that are present in the pen trajectory. Secondly a macro could be written which dissects the pen trajectory into segments. And, thirdly, these segments can also be entered, or changed, manually by using the requester displayed in Figure 4.



[Screen dump: Segments requester]

Figuur 4: The requester that is used for manually setting and changing segments.


Yet another group of special purpose actions is formed by the analysis system. By using a small built-in statistical package OASIS can perform a complete analysis of all common pen variables. Around 750 different statistics are computed for each part of a pen trajectory that is analyzed. This analysis assumes that there are five basic conditions the pen tip can be in; Down, Jump, Move, Pause, and Stop. In the Jump condition the pen is above the digitizer and the other four conditions cannot occur. In the Down condition the pen is on the digitizer and can either be in the Move condition or stand still. When the pen tip is standing still on the digitizer it is always in the Stop condition, but it will only be in the Pause condition when it stops longer than a predetermined duration. The built-in statistical package can compute statistics like; count, sum, minimum, maximum, range, mean, standard deviation, variance, skewness, kurtosis, standard error, median, and the Pearson correlation. The experimenter can select a certain result by choosing what kind of statistic should be computed from one of forty-seven different statistical variables. Writing the results to a text file would be done in this fashion:

(WriteText MyTextFile                           {write to MyTextFile}
   (Text (GetMean MoveAbsSpeed) 10 3)           {the statistics of}
   (Text (GetMedian DownAbsSpeed) 10 3)         {certain conditions by}
   (Text (GetMaximum DownPressure) 10 3)        {create formatted texts}
   (Text (GetSkewness DownPressure) 10 6)       {which are ten characters}
   (Text (GetVariance StrokeDuration) 10 6)     {width and have three or}
)                                               {six decimals}

Although this way of creating data files seems rather complex it has the advantage of being extremely flexible.


3. Using OASIS

OASIS is currently in use at several research institutes. Some of the newer research projects that are reported by Hulstijn (1995) were, for instance, done with OASIS. In these research projects, the effects of antipsychotic drugs in schizophrenia, the fine motor activity in depression, and bradykinesia in Parkinson's disease, are investigated with several tasks. In this section we will discuss one of those tasks, and elaborate on the implementation of two simple macros.

3.1 Figure copying task

One of the tasks, reported by Hulstijn (1995), is the figure copying task. Twenty boxes are drawn on the test paper in which the subject should copy the figures that are presented on the computer screen. Figure 5 shows a subject drawing figures on the the test paper. Each box has a 'start' circle at the lower left corner and a 'finish' circle at the upper right corner. Before a trial has started the computer screen is blank, apart from a text line that encourages the subject to start a trial, when a trial has not yet started. The subject can start a trial by keeping the pen tip for a certain amount of time in the 'start' circle. When a trial starts the stimulus is shown. All pen movements after the trial start are recorded. The stimulus will be visible until the subject starts copying it. This enables the experimenter to make a clear distinction between the time needed to analyze and remember the figure and the time needed to draw it. The 'finish' circle should be touched with the pen tip when the subject is done. After this, the figure is again shown together with the copy made by the subject. When the copy does not differ substantially from the original then the subject can continue with the next figure by moving the pen tip into the next 'start' circle. Otherwise the subject should draw a line through the copy of the figure, thereby indicating that the copy did not match the original, and redo it in the next trial. This last choice that a subject has between accepting the copy and discarding it is a clear example of the interactivity that OASIS provides.



[Photo: Hand with pen and paper]
Figuur 5: The figure copying task.


3.2 Example macros

In this paragraph we will discuss two short example macros. The purpose of the first macro is to record and save a piece of writing as shown in Figure 3. The macro text is:

{step 1: create and enter a pen space}
(CreatePenSpace PenSpace)
(EnterPenSpace PenSpace)
{step 2: record samples until a key is hit}
StartRecording
(LOOP
  NextPenSample
  (IF KeyPressed BREAK)
)
StopRecording
{step 3: request, open, and enter, a new pen file}
(OpenNewPenFile PenFile (DestRequest "RECT01.PEN"))
(EnterPenFile PenFile)
{step 4: save the recorded pen space in the pen file}
WriteNewPenRecord

Most of the actions present in this macro have already been discussed in the previous paragraphs, others may be self-evident. An action that has not yet been discussed is the DestRequest action. It pops up a requester which asks the user to enter a file name. The DestRequest action accepts a template "RECT01.PEN" of the file name. This macro shows that with a few actions an easy-to-use recording macro can be built.

The purpose of the second macro is to manually segment a piece of writing. The macro text is:

{step 1: create and enter a pen space}
(CreatePenSpace PenSpace)
(EnterPenSpace PenSpace)
{step 2: request, open, and enter, an existing pen file}
(OpenOldPenFile PenFile (SourceRequest "*.PEN" On "RECT"))
(EnterPenFile PenFile)
{step 3: read a record into pen space}
ReadPenRecord
{step 4: pop up the segment requester}
PenSegmentsRequest

Some of the actions in this macro are quite similar to the actions in the first macro. The DestRequest action has changed to the SourceRequest action. The latter action pops up a requester which asks the user to select an existing file. Once the pen file is opened, and the first record is read, the macro pops up the manual segmenting requester shown in Figure 4. The two macros presented here are only simple examples of what can be achieved in OASIS, most macros are more complex than these. The example presented in Paragraph 3.1, for instance, uses customized graphical feedback, interacts with the subject, and allows for more records to be recorded in one go. The examples presented in this paragraph could be easily extended to perform those tasks as well.


4. More information about OASIS

4.1 Hardware and software requirements

OASIS can operate on any inexpensive MS-DOS PC and occupies around 10 Mb on the harddisk. For a good performance the PC should at least contain an Intel 486DX processor running at 66 MHz. The program currently only runs under MS-DOS. It can however run in a DOS-box under Windows 95 or OS/2, but not in a DOS-box under Windows 3.1. OASIS uses WACOM digitizers which can be equipped with a 'normal' wireless, pressure sensitive, inking or non-inking pen. Pen pressure can also be calibrated. It is possible to integrate the digitizer in the normal writing surface to make the writing conditions even more equivalent to normal writing. OASIS could also be used in a portable system when a portable PC and a small type of digitizer is used.

4.2 Support and current developments

More information about OASIS can be obtained from the authors of this article. OASIS will be supported and extended in the future. Once the Windows 95 or Windows NT operating systems have become the standard for PC's, OASIS will be ported to those systems. We are also planning and working on the development of macros for pen-and-paper neuropsychological tests. OASIS makes it possible to use the standard tests without any modifications, while it still can provide a lot of extra and more detailed information. One of the newest modules that has been recently added to OASIS is the Power Spectral Density Analysis (PSDA) module. This module enables the researcher to create power spectra from any of the pen signals, or their derivates, that are present within OASIS. Figure 6 shows a window in which a signal and its spectrum is shown.



[Screen dump: Spectral Analysis]

Figuur 6: Spectral analysis in OASIS.


References

Fitts, P.M. (1954). The information capacity of the human motor system in controlling the amplitude of movement. Journal of Experimental Psychology, 47, 381-391.

Hulstijn. W. (1996). Writing and drawing in neuropsychology: Studies on psychomotor slowness. In: M.L. Simner, C.G. Leedham, A.J.W.M. Thomassen (Eds). Handwriting and Drawing Research: Basic and Applied Issues. Amsterdam: IOS.

Smits-Engelsman, B.C.M., Van Galen, G.P., & Portier, S.J. (1994). Psychomotor aspects of poor handwriting in children. In: Simner, M.L., Hulstijn, W., & Girouard, P.L. (Eds) Contemporary Issues in Forensic, Developmental, and Neurological Aspects of Handwriting. Monograph of the association of Forensic Document Examiners, vol. 1, Toronto, pp. 17-44.

Thomassen, A.J.W.M., Meulenbroek, R.G.J., & Lelivelt, A.B.M. (1994). Multiple adaptions to externally controlled progression velocity in handwriting. In: Faure, C., Keuss, P., Lorette, G., & Vinter, A. (Eds). Advances in handwriting and Drawing. Paris: Europia.