Ultrasession in opensesame
From Phonlab
Jump to navigationJump to searchThe recommended way to acquire ultrasound data in the Phonology Lab is via an Opensesame experiment. You can use Opensesame to display a series of prompts to a subject and use inline scripts to run and control the data acquisition utilities. A simple experiment proceeds like this:
- Set configuration variables related to data acquisition.
- Initialize the ultrasound acquisition system.
- Loop over a list of stimuli which are used to prompt the subject.
- Display a preparatory prompt to the subject.
- Start data acquisition with
ultrasession.py
and wait until the ultrasound system confirms that it is imaging. - Display a speaking prompt to the subject during data acquisition. This prompt can be shown for a defined duration, or it can be displayed until the subject presses a key.
- Send a signal to
ultrasession.py
to stop data acquisition.
Sample experiment
The steps shown above are followed in a sample experiment available on github. See the test experiment provided in the latest release.
The sample experiment relates to the steps as follows:
- the
ultrasound_arguments
inline script defines variables related to data acquisition. The most important variables to change aremyparams
, which points to your imaging parameters file, anddatadir
, which is the parent directory for your timestamped acquisitions. In the Phonology Lab the datadir should be somewhere on theU:
drive. Setdo_log
toTrue
if you wantultracomm
to produce a detailed log of its activity.
- the
init_ultrasound
inline script initializes the Ultrasonix system. You should not need to make any changes to this script.
- the
stimuli
object contains a list of prompts to display to the subject. The prompts are provided in thestimulus
variable, and it will be simplest if you give your variable the same name.
- the
display_word_prep
object shows the preparatory prompt to the subject. Customize this display for your own needs.
- the
run_ultrasession
inline script startsultrasession.py
and waits until the ultrasound system has confirmed it is imaging. You should not need to change this script unless you did not name your prompt variablestimulus
.
- the
display_word_while_acquiring
object displays the acquisition prompt to the subject. Customize this display for your own needs. It can end after a duration of your choosing, or on a keypress.
- the
stop_acquisition
inline script terminatesultrasession.py
. You should not need to change this script.