Tracking Target and Spiral Waves with SpiralTrack
Jon Sporring
SpiralTrack is program for analyzing the dynamics of target and
spiral waves as generated by many physical, biological, and
theoretical processes. The theory behind SpiralTrack is
described in [#!Tek:Sporring98d!#].
The program is written in Java 1.1.7 and thus requires the java
virtual machine version 1.1.7 or higher. The java virtual machine can
be obtained on:
http://java.sun.com/products/jdk/
SpiralTrack is started by typing the following from a command
prompt:
cd SpiralTrack
java Main <imagedir>
where <imagedir> is a directory containing the images to be
analyzed. The program can read Jpeg and Gif images, and will sort the
list of files in <imagedir> alphabetically. The list obtained
is interpreted as the image sequence to analyze. If the program is
successfully started, the main window will open together with an
output window.
The main window is always open when SpiralTrack is running. The
program has three main modes of operations: Test, Start, and Stop. In
test mode can the setting of the parameters be controled, and in start
mode will the full sequence be analysed for spirals and circular
structure. When the program is in stop mode no computation is
performed on the images. In Figure 1 is shown a typical
example of how the main window can look.
Figure 1:
The Main Window
 |
The main window controls the calculations performed by SpiralTrack. The interaction with the user is organized in lines.
They are:
- Directory
-
In the directory field the current directory is shown. If the
path is too long, the first part is abbreviated with '...'.
- First file
-
The first file field displays the filename of the first file.
Clicking on this button, pops up a file dialog window, from which
a new first file can be chosen. The first file is not allowed to
be alphabetically after last file. A directory change effects the
Directory and Last file fields together with all output windows.
- Last file
-
The last file field displays the filename of the last file. This
field works similarly to the First file field.
- Minimum Length
-
When the program is in start mode, the images will be analyzed
sequentially. If the previous image did not have an spiral or
target center nearby then a new path is initiated. Conversely,
all paths that do not have a continuation in the current image of
process will be terminated. The minimum length field sets the
minimum length a path can have to be taken into consideration.
This value is only used in start mode (see below). If it is 1,
then it does not have any effect, and all extrema and their paths
will be shown.
- Measurement scale
-
The measurement scale t controls the degree of Gaussian
smoothing of the edge operator. In test mode this parameter
effects the black edge lines. The computation time is directly
proportional to t, and the smoothing corresponds to smoothing
with a Gaussian kernel of variance 2t. I.e. setting this
parameter high increases computation time but also reduces the
effects of noise. For line structure of width d pixels it is
reasonable to set the measurement scale to d2/8.
- Integration space-scale
-
The integration space-scale controls the degree of Gaussian
smoothing of the spiral centers. In test mode this parameter
effects the number and position of the green circles. This
parameter is similar to the above. For spirals of wave length d a useful setting is about d2/8.
- Integration time-scale
-
The integration time-scale field sets the time-scale parameter a controls the degree of exponential smoothing along time. This is
implemented as a first order recursive function using:
Si+1 = I+aSi
where Si is the current sum, and I is the current internal
voting image for spirals. For more details on the voting scheme,
see [#!Tek:Sporring98d!#]. The implication of the above, is that
if a=0 then no smoothing along time is performed, and if a=1 then the smoothing is uniform. In between are exponential
filters. This parameter has no effect in test mode.
- Action
-
The Action filed allows the user to control the computation state.
Three action modes are available. Test mode allows the user to
online experiment with some of the parameters. The edges and
spiral centers will be shown in all output windows. In start mode
will the program evaluate all images in the image sequence and
display the paths on the output windows. Paths that has a length
less than Minimum length is not displayed, hence there will at
least be no paths displayed before as many images as indicated by
Mimimum length has been analyzed. Stop mode is the default, and
deactivates any computation.
- Status
-
This is a message field indicating the status of SpiralTrack. Some possible messages are
- Idle - no computation is performed.
- Testing - SpiralTrack is in test mode.
- Calculating - the program is in start mode.
- Load/Save
-
Pressing either of these two buttons opens a file dialog, and the
user may load or save spiral paths. The file format is in
Backus-Naur form given by
pathfile =
{<comment>}<newline>
``deadPaths''<newline>
{paths}
``alivePaths''<newline>
{paths}
paths = <number of paths><newline>
{<number of coordinates><newline>
{<x><newline>
<y><newline>
<z><newline>
<f><newline>}}
where <comment> is any text (except
``deadPaths''<newline>), <newline> is the newline
character, <number of paths> and <number of coordinates> are integers, and <x>, <y>, <z>, and <f> are
floats.
- New Window/Reset/Quit
-
The new window button opens a new output window. The reset button
completely resets SpiralTrack to the initial state. Be
warned that all parameter settings are reset. The quit button
terminates the program.
The main purpose of an output window is to show the results of the
calculations performed by SpiralTrack. Initially a single
output window is opened by SpiralTrack. An example is shown in
Figure 2.
Figure 2:
An Output Window
 |
An arbitrary number of output windows may be opened by the user.
An output window has the following content:
- Top
- The image name,
- Right
- A scrollbar to choose between images from the directory
list,
- Middle
- A graphical display showing the image chosen by the
scrollbar and possibly the results of the testing phase or the
tracking phase.
- Bottom
- A close button.
If the directory list is empty, the output window will display the
``No File'' in the image name field.
During testing or tracking is it advantageous to open several output
windows and use the scrollbars to examine different images.
In test mode the edges used (black lines) and the centers found (green
circles) are shown. In start mode the paths are divided into alive
(green) and dead (red), where a path is dead if it does not connect to
the image just processed. Both alive and dead paths start with a blue
circle and ends with a green or red circle respectively.
This program is based on the work described in [#!Tek:Sporring98d!#].
No References!
sporring@diku.dk
Flemming
1998-11-20