Tcl/Tk Scripts for the FeatureSet Object: featshow
Tcl/Tk Scripts for the FeatureSet Object: featshow
![](images/featshow.gif)
Syntax:
featshow <feature set> <feature> [<width> [<height>]]
Example:
featshow fs ADC 900 250
Creates an interactive display showing features of a featureset.
Optional flags:
<width>
- <width> is the pixel width of the plot region. The window
including all the buttons and scales might be bigger.
<heigth>
- <height> is the pixel height of the plot region.
Related procedures:
featview
The window (featshow window) created by the 'featshow' procedure
can be divided in 4 major parts.
From top to bottom: a menu/button bar (1),
a canvas region (2),
an info region (3).
Sometimes on the right side: a selection list (4).
The whole window is surrounded by a frame of the window manager giving
the number of the featshow window and the name of the displayed
feature. Knowing the number the user can change some properties of the
featshow window. This number is also the return value when the procedure
is called.
Both feature types (FMatrix and SVector) can be displayed in the featshow
window. The featshow window will change its appearance a little bit
depending on the type and some buttons will only work for one type (like
the play button makes only sense for SVector features representing samples
of a time signal).
canvas region (2)
Here the canvas region is explained first since it is the heart of the
featshow window. It consists of the actual plot region (2a) and
might also contain a scale (2b) and bars (2c) showing which
region of the whole feature is selected (blue) and which one is displayed
(grey). Two blue markers in the plot region (2a) indicate which feature
region is selected. If the feature is displayed as a function and not as
grey values the space between the two markers is also colored in a light
blue.
If the feature is of type SVector there is also an amplitude scale on the
right side allowing the user to control the display range.
Clicking on the mouse-buttons 1 to 3 in the bar field (2c) moves
the grey, lower bar and also changes the displayed feature region.
Using the mouse-buttons within the plot region (2a) can be used to:
- mouse-button 1
- set the left marker side or 'flip' the two markers if the left
one would be to the right of the newly selected region.
- mouse-button 2
- play the selected region (only SVector type)
- mouse-button 3
- set the right marker side or 'flip' the two markers.
info region (3)
The info region gives information about which frames or samples are
displayed and marked and how many coefficients the feature has. It
contains also buttons to change the displayed region.
menu/button bar (1)
With the menus and buttons the user can control the appearance and
properties of the featshow window:
- Quit button
- Close the featshow window.
- Feature button
- Display the selection list (4) on the right side of the
featshow window containing all features available in the feature set.
With the mouse-buttons the features can be selected or added to be
displayed.
- Display menu
- new frame
- create another featshow window
- mode
- select the display mode
- ruler
- show ruler (2b) or not, use time or samples(frames)
- bars
- show bars (2c) or not
- size
- set size of the plot region (2a)
- colors
- select colors
- Marker menu
-
- Device menu
- With this menu a playing device can be selected or set by the user.
To the right of the menus two zoom buttons and a play button can be found.
There is also a field showing the sampling rate. The sampling rate of the
feature can be changed here. This might effect the time scale, the marked
region and of course the hearing result when the feature is played.
Customizing
All properties of the featshow window can be changed more or less with
the buttons or menus during run time but sometimes it might be useful
to determine a specific setup in advance.
Playing Device
The playing device can be set before or after the procedure is called.
Use the global Tcl variables DEVICE and USERDEVICE to do so.
These variables will effect all featshow windows.
Window Properties
The return value of the procedure is the number of the featshow window.
During the procedure a global Tcl array is defined called fsPar.
By manipulating the values the properties of the featshow window can be
set automatically after calling the procedure.
Example: We want the scale in time units but the default is not
in time units. For this reason the value of the variable
fsPar($number,time) must be 1, where $number is the number of our featshow
window.
set fsX [feashow fs ADC]
set fsPar($fsX,time) 1
WARNING: You mustn't use fsN because this is a global Tcl variable
indicating how many featshow windows exist!
Here is a (uncomplete) list of variables that you might want to set
this way:
- fsPar($fsX,fe)
- name of the feature to be displayed
- fsPar($fsX,grey)
- display mode: 0..4
- fsPar($fsX,ruler)
- show ruler: 1 (yes) or 0 (no)
- fsPar($fsX,bars)
- show bars: 1 (yes) or 0 (no)
- fsPar($fsX,time)
- scale in time units: 1 (yes) or 0 (no)
- fsPar($fsX,mfrom)
- left marker in seconds
- fsPar($fsX,mto)
- right marker in seconds
- fsPar($fsX,showlabel)
- show labels: 1 (yes) or 0 (no)
- fsPar($fsX,labels)
- variable containing labels, Tcl list
with elements looking like {{text} {from to}}
where from and to are frame numbers.
- fsPar($fsX,)
-
- fsPar($fsX,)
-
Labels
The word labels produced by the path method 'labels' can be displayed:
set fsPar($fsX,labels) [lindex [path$SID labels hmm$SID] 1]
westphal@ira.uka.de