Oguz Tanzer
Desktop-4D-Toolbox (D4D) User Manual
Desktop-4D-Toolbox (D4D) User Manual
Figure
http://syke.hut.fi/~tanzer/d4d
Contents
1 Introduction
2 To whom this package is designed for?
3 System Requirements
4 Development and Licence
5 Getting the D4D
5.1 Installation
6 Learning to Use D4D by Example
6.1 Getting Help
6.2 Sample Data
7 Using D4D
7.1 File Name Convention
7.2 Initialization of Sensor Thresholds
8 Evoked Fields(EF)
8.1 Calculating Evoked Fields(EF)
8.2 Viewing Evoked Fields(EF)
9 Sensor Traces
9.1 Extracting Sensor Traces
9.2 Viewing Sensor Traces
10 Frequency Analysis: Power and Amplitude Spectra
10.1 Calculating Power and Amplitude Spectral Density (ASD)
10.2 Viewing Power and Amplitude Spectra
11 Time Frequency Representations(TFR) Using Wavelets
11.1 Calculating TFR for Single Sensor Data
11.2 Calculating TFR for All Sensors
11.3 Viewing TFRs
12 Phase Locking Factor (PLF)
12.1 Calculating the PLF
12.2 Viewing the PLF Calculation
13 Topographical Color Plots on Neuromag Helmet
14 Post Processing Functions
1 Introduction
Desktop-4D-Toolbox (D4D) is a window based data analysis platform
for analyzing and visualizing magnetoencephalographic (MEG) data
currently supporting Neuromag MEG Data. The analysis functions are
based on scripts of 4D Toolbox by Ole Jensen and also employs the
FIFF (Neuromag Data Format) to MAT conversion routines which are
developed by Kimmo Uutela and the public distribution is
supported by Neuromag Ltd.
The goal of this tool is to create an efficient and organized data
analyzing environment for research on MEG data for
neuroscientists.
It is designed with the idea that, the collected data can be
analyzed relatively quickly by users with graphic handles such as
edit boxes and data sliders.
The graphical user interface reduces the amount of repeated tasks
by eliminating writing or changing of Matlab scripts to perform trivial
operations to analyze the MEG data at hand.
An important design concept was to enable or disable the user when
enough parameters are not present to analyze the given data. This
includes the disabling of the fields regarding the analyzing
function when enough parameters are not available.
Desktop-4D-Toolbox should also be well suited for unexperienced
users, who want to learn about the effect of certain parameters on
the MEG data quickly.
2 To whom this package is designed for?
The D4D is designed especially for people without computer
programming or script programming background, but would like to
analyze MEG data with the tools provided with the 4D
Toolbox.
Users with computer programming background, or who find this
package limiting can also refer to the scripts of 4D-Toolbox.
Users can also refer to 4D-Toolbox manual for further information
on availability of the tools.
The main features of the D4D include:
- Analyzing MEG data without writing scripts
- Better interaction with data using graphical
adjustment of parameters and data hiding
- More organized data analysis
- Colored views of files in current directory with
bookshelf approach
- Some data post-processing
- Changing graph view parameters for nice printouts (Future version)
- Usability under various environments with Matlab
3 System Requirements
The software is designed and written under Matlab and works under
Matlab 5.x and Matlab 6.x versions. It requires that the FIFF to
Matlab routines and 4-D Toolbox scripts are in the same directory
as the D4D components. The raw FIFF to Matlab conversion routines
are pre-compiled binaries are tested to work
in HP-UX and Linux systems.
Table 1 shows the platforms this package is tested.
Machine Type | Matlab version | operating system |
IBM-PC | Matlab 6.1 | Linux |
IBM-PC | Matlab 6.1 | MS Windows 2000* |
HP | Matlab 6.1 | HP-UX |
Table 1: Machines and operating systems on which D4D has been
tested (as of September 2002)
*Since D4D is implemented completely in Matlab, it is possible to
use the package in any environment where Matlab is supported, but
the FIFF to Matlab conversion routines currently work only under
Linux and HP-UX. However, other data, saved in Matlab ".MAT"
format could be analyzed. For example, extracted data could be
sent to an MS Windows environment and other tasks could be
performed.
4 Development and Licence
The D4D is designed and written by Oguz Tanzer at Laboratory of
Biomedical Engineering, Helsinki University of
Technology.
The package is continuously updated so please check frequently for
new function updates. It is user's own responsibility to check the
results of the package. This is a new distribution and bugs in the
package are inevitable. Please report them to
tanzer@syke.hut.fi also feedback is very valuable
and encouraged.
D4D is a free software (but not the conversion routines converting
FIFF to Matlab format) This allows you to re-distribute and modify
the functions under the terms of the GNU general public licence as
published by the Free Software Foundation.
5 Getting the D4D
All the components of the software can be downloaded from the D4D
webpage: http://syke.hut.fi/~tanzer/d4d
The D4D requires 4D-Toolbox
(http://boojum.hut.fi/~ojensen/4Dtools)
scripts and the FIFF to Matlab conversion routines
(http://boojum.hut.fi/~kuutela/meg-pd/).
Please refer to
their individual web pages on specific information about these
software.
5.1 Installation
Use the following command to unpack the .TAR file:
>tar -xf d4d.tar
and follow the appropriate instructions below. If you already have
4D-Toolbox installed skip step 1 etc.
Steps of a from scratch installation are as follows:
- Install 4D-Toolbox http://boojum.hut.fi/~ojensen/4Dtools
- Install FIFF access routines http://boojum.hut.fi/~kuutela/meg-pd/
- Extract d4d.tar to the same directory where the 4D-Toolbox
scripts reside.
6 Learning to Use D4D by Example
In this section the components of the D4D is explained and how to
use is explained via an example tutorial. This tutorial is the D4D
version of the same material found in 4D-Toolbox manual. The same
data file is used. The idea is that the user can perform the same
operations as in 4D-Toolbox using the user interface following the
protocol of D4D.
6.1 Getting Help
A nice part of the D4D is that, user is provided with pop-up tips
on what each graphical object does. Also, each button is labelled
intuitively regarding the function it performs.
6.2 Sample Data
The file mnStim150.fif used in the tutorial can be
downloaded from the D4D webpage:
http://syke.hut.fi/~tanzer/d4d or from the 4D-Toolbox
webpage: http://boojum.hut.fi/~ojensen/4Dtools
After downloading move the file to the working directory and unzip
using the command:
>gunzip mnStim150.fif.gz
The FIFF file mnStim150.fif contains raw MEG data recorded
by Neuromag Vectorview system (306 sensors) and the data are from
an experiment in which a subject received alternating stimuli to
the left and right median nerve at wrists. The times of left and
right hand stimulation are respectively marked by trigger channel
1 and 2. There are about 200 stimuli per hand. The interstimulus
interval was 3 second, each side. The data were digitized at 600Hz
[1].
Figure
Figure 1: The main window of D4D.
7 Using D4D
Open Matlab and goto the directory where D4D and 4D-Toolbox are
installed. Enter command:
> d4d
The main window shown in Figure 1 will come up
and the program is ready to start.
Make sure the data file is in the same directory as the programs
files. In future versions possibly a separate data directory could
be possible.
As explained above, the interface of D4D will be explained with an
example. This is the same example found in 4D-Toolbox manual, so
previous users could be familiar to this one.
7.1 File Name Convention
The D4D has a unique but simple file naming convention with an aim
to organize the files after data analysis.
When an inputfile is loaded into the environment and an
analysis is performed on the loaded data, the type of analysis is
embedded into the output filename. A distinct view of the output
data files in the current directory can be seen by pressing
Show Available Data menu option on the main
window. This results in the available data file window shown in Figure 2
In this example case, the input filename is mnStim150.fif.
Accordingly the output filename would be;
FOR EVOKED FIELD OF 1st TRIGGER:
out_ef_trig1_mnStim150.fif
FOR SINGLE SENSOR TRACE OF 1st TRIGGER FOR SENSOR
1:
out_trace_trig1_sensor1_mnStim150.fif
These files can be seen from the Available Data menu
option (Figure 1) once created.
In general the naming convention of the output files go as;
FOR EVOKED FIELDS: out_ef_trig<#>_<inputfile>
FOR SINGLE SENSOR TRACES: out_trace_trig<#>_sensor<#>_<inputfile>
FOR AMPLITUDE SPECTRAL DENSITY: out_asd_<inputfile>
FOR POWER SPECTRAL DENSITY: out_psd_<inputfile>
FOR TIME FREQ. REPRESENTATION OF 1 SENSOR:
out_tfr_trig<#>_sensor<#>_<inputfile>
FOR TIME FREQ. REPRESENTATION OF ALL SENSORS:
out_tfr_trig<#>_all_<inputfile>
Figure
Figure 2: The output data file in the current directory are grouped
into the type of analysis performed.
7.2 Initialization of Sensor Thresholds
The parameters which define the threshold setting for the sensor
rejection are displayed on the upper part of the main window as
shown in Figure 3. The version 1.0 of the D4D
does not allow changing of these parameters from the GUI.
If you want change some rejection parameters, simply open the
parameter file shown in Figure 3 and edit the
fields with a text editor. It is hoped that the future version
will enable changing these from the user interface.
Figure
Figure 3: The parameters which define the threshold setting for the
sensor rejection.
8 Evoked Fields(EF)
8.1 Calculating Evoked Fields(EF)
The evoked fields are
calculated from part 2 of the main window of
D4D Figure 4.
Figure
Figure 4: The part of the main window which EF's are calculated.
The input parameters in this case are duration which EF's will be
calculated, the first being pre-stimulus interval and second the
duration after the trigger and the trigger number which the EF's
will be calculated.
After choosing the duration and the trigger press the Read Evoked Fields, the
extraction will begin with an indicator showing the approximate
duration to finish.
It is inevitable that some of the sensor traces are rejected due
to high noise in that particular channel. Although there is a part
in the main windows where these channels can be viewed the version
1.0 does not support this. However these bad channels can be
observed from the command line output on the Matlab command
window. After identifying the bad channel number, the
Mark button can be used.
8.2 Viewing Evoked Fields(EF)
After the calculation, the EF's can be viewed from the menu item
Plot Data \hookrightarrow Plot Evoked Response. The new
window (Figure 5) now shows the viewing options and
parameters. Either single sensor fields or EF for all the sensors
can be
viewed.
Comparison of EF's with respect to different triggers are possible
using the Compare EF's option.
Figure
Figure 5: EF plot window.
An example output of the evoked field can be seen on
Figure 6.
Figure
Figure 6: The results of the EF analysis can be quickly observed.
Here the graph in blue shows the EF for Sensor 121 for Trigger 1
and the green graph shows the EF for the Sensor 121 for Trigger
2.
The D4D allows multiple EF's to be plotted on the same graph for
comparison with different colors using the Hold Plot and Plot
Color options on Plot Evoked Response window (Figure 5)
9 Sensor Traces
9.1 Extracting Sensor Traces
Extraction of traces for one
or all channels is possible from the
part 3 of the main window shown in Figure 7.
The trigger to which the traces could be extracted and the sensor
can be selected.
Figure
Figure 7: The part of the main window where sensor trace extraction
parameter is set. In addition to this, the trigger is selected
from part 2 of the main window shown in Figure 4
9.2 Viewing Sensor Traces
The traces can be viewed from the menu item Plot Data
\hookrightarrow Plot Trace. The window shown in
Figure 8 now shows the viewing options. There are
also two preprocessing options present, which are Subtract
Baseline and Apply Smoothing. The Subtract
Baseline subtracts a baseline between the two time parameters
given in seconds from the averaged traces. The
Apply Smoothing button performs smoothing by
Savitzky-Golay filtering using the given number trace
width [1]. Refer to [1] and [2] for
more information about this
parameter.
Figure
Figure 8: The results of the Trace analysis can be quickly plotted
using the Plot Trace menu option from the main window.
10 Frequency Analysis: Power and Amplitude Spectra
10.1 Calculating Power and Amplitude Spectral Density (ASD)
The power and amplitude spectral density (ASD) of a data set can
be calculated using part 4 of the main window shown in
Figure 9 with Calculate ASD and
Calculate PSD. The functions are based on Welch's method
for applying data
windowing and fast-fourier transform (FFT) [1].
The ASD's are calculated are calculated irrespective of the
triggers and the default number of points used in the FFT
algorithm is nfft=256 [1]. The ASD's are calculated
using Welch's method: the time is subdivided into windows of
length nfft with 50% overlaps. Each subtrace is then
detrended and multiplied to a Hanning window and then the absolute
values of the Fourier transformed windows are
averaged [1,3]. The nfft determines the
frequency resolution of the ASD. A larger value for nfft
results in more narrow spectral peaks but a more noisy base level,
a smaller value lowers the noise of the base level, but broadens
the spectral peaks [1].
The power spectral density (PSD) is also calculated using
Calculate PSD button.
Figure
Figure 9: The Amplitude Spectral Density (ASD) and Power Spectral
Density (PSD) can be calculated from the part 4 of the main
window.
10.2 Viewing Power and Amplitude Spectra
The results of the ASD and PSD calculation can be viewed from the
menu item Plot Data \hookrightarrow Plot ASD and PSD.
The window (Figure 10) shows the viewing options.
The ASD and PSD can be plotted for a single sensor or for the
whole set of sensors.
Note that the ASD's for the gradiometers with the same location
but orthogonal orientations are averaged. The division of the
sensors into 3 sets is done the same way as viewing the Evoked
Fields [1].
Figure
Figure 10: The results of the Frequency analysis can be quickly
plotted using the Plot ASD-PSD menu option from the main
window.
11 Time Frequency Representations(TFR) Using Wavelets
TFR's are used to study how oscillatory signals evolve over time
and with TFR it is possible to calculate and visualize a broad
range of frequencies simultaneously [1].
The TFR's are calculated using a method based on Morlet
wavelets: for a given time and frequency a Morlet Wavelet is
convolved to the data. The squared absolute value is the energy
(power) of the signal and the width of the
wavelet determines the time and frequency resolution
[1,4,5].
11.1 Calculating TFR for Single Sensor Data
TFR's for multiple traces extracted with respect to a trigger, can
be calculated and averaged using part 5 of the main window shown in Figure 11.
The parameters to be adjusted here are the Frequency Range and the
frequency increments of the TFR calculation. The width(in cycles)
of the wavelet used can be adjusted. If the value is increased the
frequency resolution becomes better, but the time resolution is
worse and vice versa and it is not recommended to use a value less
than 5 as stated in [1]. The time interval with respect to
the trigger (pre and post) for which TFR's are calculated can be
adjusted from Figure 4
Figure
Figure 11: Time Frequency Representations(TFR), can be calculated
from the part 5 of the main window. In addition to this, the
trigger and time interval with respect to the trigger (pre and
post) is adjusted from Figure 4
11.2 Calculating TFR for All Sensors
The TFR for all sensors can be calculated for all sensors using
the For All Sensors switch in Figure 11 in
the main window. The same parameters are used for calculating the
Single Sensor TFR calculation. The time interval with respect to
the trigger (pre and post) for which TFR's are calculated can be
adjusted from Figure 4
11.3 Viewing TFRs
The results of the TFR calculation can be viewed from the menu
item Plot Data \hookrightarrow Plot TFR.
The window in Figure 12 shows the viewing options.
The TFR can be plotted for a single sensor or for the
whole set of sensors. The TFR for gradiometers which have the same location but
orthogonal orientation are averaged in the same graph. The minimum
and maximum energy together with z-limits can be set.
Figure
Figure 12: The results of the TFR analysis can be quickly plotted
using the Plot TFR menu option from the main window.
12 Phase Locking Factor (PLF)
12.1 Calculating the PLF
The Phase Locking
Factor-PLF is a tool for characterizing evoked activity, phase
locked to the stimuli [1,6]. For a sensor or a set of
sensors, the PLF can be calculated from the traces extracted. The
absolute value, abs(PLF), yields a number between 0 and 1
determining the degree of phase locking.
Phase Locking Factor(PLF), can be calculated from the part 5 of
the main window(see Figure 11). In addition to this,
the trigger and time interval with respect to the trigger (pre and
post) is adjusted from part 2 of the main window (see
Figure 4).
12.2 Viewing the PLF Calculation
The results of the phase
locking factor can be plotted using the Plot PLF
selection from the main menu. Figure 13 shows the
plotting window.
Figure
Figure 13: The results of the PLF analysis can be quickly plotted
using the Plot PLF menu option from the main window.
13 Topographical Color Plots on Neuromag Helmet
Mentioned in [1] these kind of plots are useful when
studying the spatial distribution of a processed signal.
The Neuromag helmet plots can be displayed using the menu item Plot Data
\hookrightarrow Plot Neuromag Helmet.
The window in Figure 14 shows the viewing options and Figure 15 shows a result of the output.
Figure
Figure 14: The Neuromag helmet plotting
window
Figure
Figure 15: The plot of the helmet for a signal vector with either 61
or 102 elements
The colored helmet plotting can be done for a 61-element or
122-element vector on the workspace. The workspace variables can
be seen in the selection box. Press the Update button to
refresh the selection box and view the latest variables on the
desktop. By pressing the Plot Helmet button the vector is
plotted on the Neuromag Helmet.
As an exemplary case "the relative rebound of the mu-rhythm" can
be calculated using the parameters on the bottom of the window.
The parameters to be adjusted are the Frequency band, Time
Interval for the energy to be calculated and the time interval
preceding the stimuli [1].
14 Post Processing Functions
Some post processing functions for analyzed data can be applied
using the Postprocess window shown in
Figure 16.
This window can be accessed from the Postprocess menu item from the main window.
Figure
Figure 16: Some post-processing functions can be applied to the data
currently on the workspace
To apply filters to the data;
- Load data to the workspace by pressing Load
Dataor press Update
- Choose the data vector or matrix from the listbox
- Enter the necessary parameters for the chosen filter and
apply.
The functions in this window (Figure 16 can
apply the following filters [1]:
- FFT Bandpass Filter
- An acausal (zero phase shift) FFT Bandpass filter. Filter function is constructed
using a Hamming window [1,2]
- FFT Lowpass Filter
- An acausal (zero phase shift) FFT Lowpass
filter. Filter function is constructed using a Hamming window [1,2]
- FFT 50Hz Notch
- An acausal (zero phase shift) 50Hz notch
filter [1].
- Line Noise Reduction(50 Hz) Filter
- The amplitude and
phase of the line noise is estimated. A sinusoid with these
characteristics is then subtracted from the signal [1].
- Smoothing
- Smooths a data array using Savitzky-Golay filtering [1].
References
- [1]
- O. Jensen. 4-D Toolbox v1.2 Manual, 2001
- [2]
- W.H. Press, S.A. Teukolsky, W.T Vetterling
and B.P. Flannery. Numerical Recipes in C. Cambridge University
Press, USA, 1997
- [3]
- E.C Ifeachor and B. W. Jervis. Digital Signal
Processing. A Practical Approach. Addison-Wesley, 1993.
- [4]
- J. Sinkkonen, H. Tiitinen and R. Naatanen.
Gabor Filters: an informative way for analysing event-related
brain activity. J Neurosci Methods, 56(1):99-104, Jan
1995
- [5]
- C. Tallon Baudry, O. Bertrand, C. Delpuech and J.
Pernier. Oscillatory gamma band(30-70 Hz) activity induced by a
visual search task in humans. J Neurosci, 17(2):722-734,
Jan 1997
- [6]
- C. Tallon Baudry, O. Bertrand, C. Delpuech and J.
Pernier. Stimulus Specificity of phase-locked and non-phase locked
40 Hz visual responses in human. J Neurosci,
16(13):4240-4249, Jan 1996
File translated from
TEX
by
TTH,
version 3.13.
On 8 Oct 2002, 22:23.