EEG Display

Buttons

Mouse

Chart of all mouse operations
Time selection
Tracks selection
Bad tracks selection
Horizontal scrolling  or  Next / Previous tracks
Horizontal  or  vertical zoom
Relative vertical zoom
Keep current sub-window
Drag & Drop

Keyboard

Moving the cursor
Next  or  previous page
Beginning  or  end of Eeg
Quickly creating markers
Quickly jumping the cursor by blocks

Menus

Edit
Selection
Markers
Options

EEG - Buttons

Go here for the buttons common to all views.

Linking to other Eegs 

The way to proceed is the very same as for any standard view , but the targeted windows are exclusively restricted to other Eegs only . The link behavior is also slightly different from the standard link which is purely graphical. Here the window owner of the links will load the external data, use them as its own to superimpose them. If the user changes the number of tracks, scalings etc..., all linked data will also move accordingly (except filtering, which is still the sole responsability of each individual Eeg). Here is an example with 2 Eegs:

linked by=

Changing the number of tracks will naturally affect all the linked Eegs (here with 3 Eegs):

The color scheme for the linked tracks is the following: black, red, green, blue, cyan, magenta, yellow, then again these 7 colors in dashed, then cycles back to black, red, green, etc... You may find useful to also change the line width of the plotting to improve clarity.

Another point. Though Eeg views can only link to other Eeg views, non-Eeg views can link to Eeg views, so you can have this kind of display (a scalp potentials linking to a 3D view of its tracks):

Rendering 

(Go here for basic explanations on rendering)
Toggles between 3 or 5 display modes:

If the Eeg has been linked with some electrodes coordinates , that is, if geometrical information is available, the following 2 modes are also available.

 

Tracks / Bars / Intensity display 

This button lets use choose between Tracks (line plots), Bars (filled) and Intensity (colors) displays:

Showing the Regions Of Interest 

This button is enabled if a .rois file is available in the link many file , and the dimension of the rois is equal to the number of electrodes .

Pressing this button will cycle within all possible rois listed in the link many file. Once a roi is active, the tracks are grouped by each roi. And within each roi, tracks are also re-ordered, which could be a convenient way to reorganize tracks on the display!

 

Here is an example of 4 rois shown simultaneously; and then when only one roi is selected, with the tracks within it appearing re-ordered (according to the ROIs file):

 

The .ris files can, too, benefit from the ROIs, resulting in a far cleaner display. In this case, just provide the ROIs for Inverse Solutions :

You might be interested to learn how to create the rois file , too?

Averaging ROIs 

If some rois are currently active, this will average all the tracks of each roi .

All the computations run first as usual (reference, filters, etc...), and only at the end the tracks belonging to the same region are averaged. All tracks of a given region will then receive the same averaged value:

See also the resulting maps of averaged rois.

Show triggers and markers 

Turns on and off the display of both the triggers and the markers (see the specific menu for the markers). Triggers/markers are drawn in green in the Eeg display, with their descriptions on upper right.

Previous trigger 

Set cursor position to the previous visible marker.

Next trigger 

Set cursor position to the next visible marker.

Add a marker 

Add a marker from the current cursor position, even if it is extended. Markers can overlap, but in this case they should differ at least either by their beginnings or their endings. Otherwise (i.e. they are equal) the old one will be overwritten.

Set the current marker description that will be used through the marker menu.

Extend cursor 

Usually, it works automatically when setting the cursor with the mouse, you can see it toggling on and off.

However, it can be sometime very useful to proceed another way:

Just be careful to close this mode, or your cursor is still "open" to modifications (which you might want, by the way)

Show upper tracks 

When only a few tracks are on display, this button shifts to "upper"/previous tracks, adding one track at a time. If holding Shift down, it will shift for the actual number of tracks at each time.

Show tracks below 

The same as previous, in the opposite direction.

Selecting a session 

This button is activated when the recording has many sessions into it (which I don't recommend nor understand, why not write a NEW file each time?). In this case, clicking on it will bring a dialog asking which session to open, starting from 1 to n. The current window will close, and reopen a fresh window of the requested session.

Less tracks 

Removes some tracks from display, starting with the last ones. Or if some tracks are currently selected, these will be removed.

More Tracks 

Brings back some tracks on display, first adding after the last ones, then filling any gaps between the first and the last of the current display.

Less computed tracks 

Removes some computed tracks from the display, starting with the last ones. Or if some computed tracks are currently selected, these will be removed.

More computed tracks 

Gets back some computed tracks from the display, starting with the last ones.

Superimpose tracks 

Superimposes current regular tracks.

When shrinking to a too small window, Cartool will superimpose tracks by itself to keep a clear display. In this case, it will also superimposes the computed tracks. At that time, toggling on or off this button will have no effect, except when expanding back the window to a regular size.

Reverse displayed polarity 

Vertically reverses the display, showing the negative values above the 0, the positive values below 0. Just the display, not the data (it seems some people like it, in the south hemisphere maybe? 8).

Show standard deviation 

This button is enabled when a file is found within the same directory, with the very same name, but with extension .epsd (standard deviation) or .epse (standard error). This detection is automatic.

This is a 3 states button:

Increase vertical scaling 

Or vertical zoom in, makes the tracks amplitude bigger. See also mouse operations and the relative mouse rescaling .

Decrease vertical scaling 

Or vertical zoom out, makes the tracks amplitude smaller. See also mouse operations and the relative mouse rescaling .

Increase horizontal scaling 

Or horizontal zoom in, makes the time interval smaller. See also mouse operations .

Decrease horizontal scaling 

Or horizontal zoom out, makes the time interval bigger. See also mouse operations .

Show amplitude units 

Draws the vertical units behind the tracks. If the tracks are too much packed, you actually won't see any effect. There should be some space in between the tracks, so select the one you are interested in, or superimpose them. Then, by changing the vertical scaling you can see the scaling adapting itself to the data.
Tracks with different units or scales, like GFP and Dissimilarity, have each a separate and different scaling used.

Show time units 

Draws time intervals behind the tracks, the space between them depending on the current horizontal scaling. The intervals are in milliseconds, starting from the beginning of the file, but if the Eeg has no sampling frequency value available, the intervals are simply put in time frames.

Filters 

Brings up the dialog with all the available filters:

Filters

 

DC / Baseline Removal

Remove the DC, or 0 Hz.

The time interval used to compute the DC depends on the context:

  •  Within an EEG display, the current page is used.
  • During Export Tracks, the whole file is being used.

The DC Removal button is automatically selected when High Pass filtering is set, as to prevent well-known instabilities from the Butterworth (IIR) filter. Still, you can turn it off manually.

You can also use it independently of the High Pass filter, just to quickly remove the baseline of the current displayed window.

Butterworth High Pass:

Specify the cut-off frequency, in Herz. See here for more details when combining with the Low Pass .

The time interval used for the high-pass depends on the context:

  •  Within an EEG display, the current page is used plus some left and right margin. The margin being equal to half the wavelength of the cut-off frequency. F.ex. 1 Hz gives 500 ms.
  • During Export Tracks, the whole file is being used.

Order (even, in [2..64]):

Order of the Butterworth High Pass.

Higher order filters perform better in terms of keeping the desired frequencies and rejecting the unwanted ones. This comes at the cost of more processing, and possible instabilities for difficult data.

Due to current optimal implementations, order must be an even number , and is currently limited to the range [2..64].

Butterworth Low Pass:

Specify the cut-off frequency, in Herz. See here for more details when combining with the High Pass .

The time interval used for the low-pass depends on the context:

  •  Within an EEG display, the current page is used plus some left and right margin. The margin being equal to twice the wavelength of the cut-off frequency. F.ex. 40 Hz gives 50 ms.
  • During Export Tracks, the whole file is being used.

Order (even, in [2..64]):

Order of the Butterworth Low Pass.

Higher order filters perform better in terms of keeping the desired frequencies and rejecting the unwanted ones. This comes at the cost of more processing, and possible instabilities for difficult data.

Due to current optimal implementations, order must be an even number , and is currently limited to the range [2..64].

Butterworth Filters Causality:

 

Causal (forward ony)

When set, this forces the filters to work as in a real-life recording machine. It filters by making use of data known so far, that is, "from the past and present" . Problem is the filtered signal has now some time delay.

Non-Causal (forward and backward)

When set (default), filters make use of all available data by applying the filters twice, once forward and once backward . The nice property is that it totally restores the time accuracy.

Butterworth Notch(es):

One or more notch values, in Herz.

As hinted, Notch filtering is done with a Butterworth Bandstop filter of order 12, and a stopband of 1Hz .

+ All Harmonics

With this option, Cartool will add all the harmonics from the list of notch frequencies above , up to the Nyquist limit. This way you save typing them yourselves, with the risk of missing some of them. And it automatically adapts the bank of filters to the actual sampling frequency.

F.ex. filtering some 50Hz power line noise with this option will filter out (assuming 1000Hz sampling frequency here):

  • 50Hz fundamental
  • 100, 150, 200, 250, 300, 350, 400, 450 and 500Hz harmonics

 

You can opt out this option to have finer control of your series of notch filters if you wish so. But be aware that even if you Low Pass to 40Hz f.ex., many frequencies well above 40Hz will still be present and will need some actions.

Spatial Filter:

Applying the Spatial Filter to the data.

Drag & Drop or click Browse to select an appropriate electrodes coordinates file .

Ranking

Rank the data. At each time frame, electrode values are sorted, and the data is then replaced with their ranks.

Results are normalized with the number of electrodes, the results therefor being in the range [0..1] (0 for the lowest value, 1 for the highest value).

<Reference computation here>

This is just to formally show where Cartool computes the reference, so just after the filters above. The next filters will use the optionally re-referenced data.

Rectification:

Making the data all positive.

Usually a step before the Envelop filter below, but it can also be interesting sometimes to force the data to absolute.

Absolute value

Absolute of input value.

Squared value (Power)

Squared of input value, therfor equivalent to a power. Of course, results are positive...

+ Envelope, of window duration:

Compute the Envelope, a kind of fast frequency analysis.

To be able to compute the Envelope, all these points must be fulfilled:

  • High- and Low-pass filters should be set
  • Some Rectification (button above) should be set
  • A sliding-window duration must be specified.
    The suggested window size is  1.5 / LowFreq

Thresholding, keeping Above:

Cutting the data at the specified threshold, keeping the values above .

Thresholding, keeping Below:

Cutting the data at the specified threshold, keeping the values below .

Both Above and Below options can be used at the same time. In that case remaining values are both above and below the specified thresholds (interval).

Options

 

Sampling Frequency (set if missing):

If the current file has a sampling frequency, its value will be shown here.

If not, the field is editable, and it is mandatory to have a value entered to be able to apply any of the filters.

Also apply filters to:

Auxiliaries Channels

Specifies if the auxiliary electrodes are to be filtered.

Switch On / Off all filters set

You can turn on and off all the currently entered filters. This is very convenient to see the effects of a set of filters, by simply turning the filtering on and off.

OK

Accept the filters.

This button remains disabled until all the parameter dialogs have received enough (and consistent) informations . If this is not the case, first check the current dialog: if its "Next" button is disabled, the problem is in the current dialog. Otherwise, browse the other dialogs for some missing informations.

Cancel

Quit the dialog, and remain in the previous filtering state.

Help

Launch the Help to the right page (should be here...).

 

Filters combination and sequence

Filters are applied sequentially, following the top-down design of the dialog . This means DC filter is first to be applied, then the Butterworth, then the Spatial Filter and so on and so forth. Most of these filters are not linearly permutables, which means the actual sequence does matter a lot on your results! The current sequence is the results of 25+ years of experience in the field.

 

When applying both the Butterworth High Pass and the Butterworth Low Pass filters , they will be automatically merged into a single Butterworth Bandpass filter (instead of running these two filters sequentially):

 

Filtering only affects the display in real-time , and does not alter the original data . To permanently change the data, you can either call File | Save As, or go through the more versatile  Export Tracks toolbox.

Filter causality

Sometimes, one needs to control how the filters make use of "data from the future", so to speak.

A filter that receives data only from the past and present is said to be causal, and non-causal if it makes use of data from the future. The latter case can only happen once the recording has been done. It is done by applying the filter once forward, then again once backward.

 

Non-causal filter

The enormous advantage of the non-causal filtering for EEG analysis is that it restores the phases of the original signal. This means peaks' locations remain stable. It also restores the phases for all frequencies, so the reconstructed signal also corresponds to the original one, minus the removed frequencies of course. It is the default option, and is widely used in the EEG community.

Note: when applying twice a filter, the decay at cut-off frequency will no longer be -3dB (filter has been applied twice!). Cartool counteracts this effect internally by operating a slight adjustment to the cut-off frequency, so that the double-filtering has an actual -3dB decay at cut-off.

 

Causal filter

This can be used if one wants to make sure no data from the future might have back-propagated and caused possible interference with the results. This option is to be used mainly for picky reviewers... Note that all real-time implementations like a recording machine must use a causal filter - if any.

One big disadvantage a causal filter is the delay added to the resulted filtered signal . Peaks locations are no longer at the right time positions! An aggravated issue is that the phase shifts differ at each frequency, slightly "scrambling" the data.

Pamphlet you can include for publications

Here is the technical pamphlet for a single Butterworth filter, replacing <actualorder> by the order used in the dialog:

The Butterworth Low / High pass filters are <actualorder> order filters, with <-20 x actualorder> dB/decade roll-off and maximally flat response. They are implemented as cascaded 2nd order sections with bilinear transform, and applied twice with one forward and one backward pass to eliminate the phase shift.

When both High Pass and Low Pass filters are applied , it ends up with a Butterworth Bandpass - note the doubling order from the dialog numbers:

The Butterworth Bandpass filter is a <2 x actualorder> order filter, with <-40 x actualorder> dB/decade roll-off and maximally flat response. It is implemented as cascaded 2nd order sections with bilinear transform, and applied twice with one forward and one backward pass to eliminate the phase shift.

The Notch filter is implemented as a Butterworth Bandstop filter - note the optional part if you selected All Harmonics:

The Notch filter is implemented as a Butterworth Bandstop filter of order 12, with -240 dB/decade roll-off and maximally flat response, and a stopband of 1Hz. It is implemented as cascaded 2nd order sections with bilinear transform, and applied twice with one forward and one backward pass to eliminate the phase shift. <optional part> Harmonic frequencies have also been filtered out with cascaded Notch filters, up to the Nyquist limit.

Note that if you are going to comment on all these filters in the same section, you can shorten these pamphlet to avoid repeating the implementation details that are exactly identical.

 

Reference

Reference used for the implementation of the Butterworth filters:

"Recursive Digital Filters - A Concise Guide",
S. Hollos, J.R. Hollos,
Abrazol Publishing, 2014, Exstrom Laboratories

Time and frequency constraints

Filters frequencies have some intrinsic limits (Nyquist and all these sorts of things), that Cartool will gracefully check for you when specifying new values. These limits depends on the sampling frequency (see below) AND the filter window (the number of time frames given to the filter function):

Spatial Filter

We developped a very specific spatial filter to improve the SNR of the data , a step which greatly improve the segmentation and the computation of inverse solution results:

 

Method description

For any given time point:

 

Here is a visual example of the 6 closest Delaunay neighbors, with the 2 extrema values removed (left), then the resulting smoothing (right):

 

Technical points

 

 

Finally, we can see here an example of before (A) and after (B) the Spatial filter, on the tracks (left) then on the maps (middle and right): 

spatial filter

 

Reference

This is the published reference about the Spatial Filter:

"EEG Source Imaging: A Practical Review of the Analysis Steps",
C.M. Michel, D. Brunet,
Front. Neurol., 04 April 2019

Average Reference 

Toggles on or off the Average Reference. This is equivalent to setting the average reference through the Menu .

Brightness 

Only when in the Intensity mode can you adjust the brightness / intensity of the colors.

This is equivalent to changing the value assigned to the maximum color.

See an example here, with the MRI display .

Contrast 

Contrast does not change the maximum value mapped to the maximum color, but changes the slope of the mapping, increasing or decreasing the color differences between low and high values.

See an example here, with the MRI display .

Color auto scaling 

Sets the maximum volume value to the maximum color value. Put it another way: automatically sets the brightness to match and correctly display the data. Consequently, the brightness buttons become inactive, but still the contrast can be adjusted.

Color modes 

Cycles through different color tables (black to white, white to black, black to yellow to white, etc...).

EEG - Mouse

Go here for the mouse actions common to all views.

Chart of all mouse operations for EEG

Alternate key

Mouse button

None

Shift

Control

Control+Shift

Left

time selection
or
rotation if in 3D

 

same as Middle
or
zoom if in 3D

same as Shift Middle

Middle

tracks selection

bad tracks selection

 

 

Right

horizontal scrolling
or
next/previous tracks

horizontal zoom
or
vertical zoom

 

baseline offset shifting 

Double Left

keep only sub-window

 

 

 

 

Time selection: left click

Click (and extend) the left button to set the current time point/time range:

If you hold down the left button, you can extend the cursor to any size you want, even outside the current window. In this case, the window will scroll while you move the cursor outside the window:

See also the keyboard way of moving the cursor .

Tracks selection: middle click

Click (and extend vertically) the middle button to select/deselect some tracks.

You can use Control + left click if you don't have a middle button. Also note that you have to click close to the baseline of the track, not on the track itself!

The selected tracks are drawn in pink:

To deselect some tracks, middle click again on them.

To deselect all tracks, middle click somewhere far enough from the tracks, say, around the electrode names.

For more controls and possible uses, see the menu Selection.

The tracks selection does not interfere with the time selection at all.

Bad tracks selection: Shift + middle click

Use Shift and click the middle button to set/reset some bad tracks.

The bad tracks are drawn in light red:

Bad tracks (broken electrode, noisy signal etc...) are taken out of the calculus of the computed tracks, and the number of significant electrodes decreased by their amount. They are also independently rescaled, so that any high amplitudes will not visually degrade the display. You can easily show or remove them through the Selection menu.

Horizontal scrolling or Next / Previous tracks: right click

Click the right button, then drag either horizontally or vertically .

If the initial direction of the mouse is horizontal, the window will be subsequently scrolled horizontally. Otherwise, the scrolling will be applied vertically, to the tracks, by shifting to the next/down tracks or the previous/upper tracks. More intuitive if you try it!

 

The visual hints associated, moving horizontally (time), or vertically (tracks):


Horizontal & vertical zoom: Shift + right click

Use Shift and click the right button, then drag either horizontally or vertically .

The direction you choose will select which dimension will be zoomed in/out: horizontal or vertical.

When zooming horizontally, Cartool will center the current view to the current cursor position, which can be handy to quickly recenter your view to a given time frame.

See also the next point below to some some tracks specifically.

 

The visual hints associated, for the vertical and horizontal zoom:


Relative vertical zoom: Control + Shift + right click

Use Control + Shift and click the right button, then drag either horizontally or vertically.

This will zoom in/out only the currently selected tracks , using the same procedure as the global scaling .

If no tracks are selected, then the global scaling applies. The procedure can be repeated as many time, and on any tracks subset, as needed.

To reset the scaling to the global default, use the  Options | Reset tracks scaling   menu.

 

This is a way you can emphasize (interesting but too small) or de-emphasize (noisy and big) some particular tracks by giving them a local scaling of their own:

Finally, note that the rescaling buttons will only work globally, even though some tracks might be selected.

Baseline offset shifting: Control + right click

Use Control and click the right button, then drag vertically .

This will move the whole tracks baseline (axis) up and down. If the data are highly skewed toward an extreme value, this allows the re-center the display around that limit, and then play with the vertical zooming as usual.

To manually set a baseline value, or to reset it to its default (i.e. 0), see the  Options | Reset baseline offset   menu.

 

See here the default baseline, and a shifted baseline of -150:

   

 

The visual hints associated when shifting the baseline:

Keep only one sub-window: double left click

When the EEG tracks are rendered into different sub-windows, double left clicking one of these will switch the display to that single sub-window alone.

Drag & Drop

You can Drag & Drop any .mrk file into the window , and all markers from that file fitting the current EEG time range will be added to the current list.

EEG - Keyboard

Go here and here for the keyboard actions common to all views.

Moving cursor

With left and right arrows, you move accordingly the time cursor . Another way is to use the mouse. However, using the keyboard is more accurate, and while holding down the key, Cartool will slowly accelerates. When the cursor leaves the last visible time frame, Cartool will scroll the display of an appropriate amount. Altogether with the acceleration, you can easily browse to even huge files very efficiently.

To prevent the automatic acceleration, press Control + left or Control + right arrows, so you can go through all time frames.

An extended cursor is moved the same way, though it may appear to behave strangely sometimes. In case the cursor is actually wider than the number of time frames currently displayed, moving the cursor forward will show only the end of the cursor. And moving the cursor backward will show only the beginning of the cursor.

Next or previous page

Use the page down and page up to jump to the next or previous screen respectively. The amount of time frames jumped over is exactly the number of time frames currently displayed. These keys will also slowly accelerate when held down.
The cursor will also jump accordingly, that is, it will remain stable within the window.

Beginning or end of Eeg

Pressing the home key will of course scroll the display to time frame 0, and set the cursor to 0. Conversely, pressing the end key will do the same with the last time frame. The number of time frames displayed is not altered.

Quickly creating markers

Pressing Control + Numpad 1 to 9 to set the any of the 9 possible quick markers:

Quickly jumping the cursor by blocks

Pressing Control + Left or Right arrow to move the cursor backward or forward, of the amount of its current size.

F.ex. if the cursor is currently extending from time frame 0 to 99, pressing Control + Right will make the cursor jump to 100 to 199, then 200 to 299 and so on. Combine this with quickly creating markers , then you have a winner combo to quickly browse a file and tag blocks of data.

EEG - Menus

Edit menu

Selection menu

This (extensive) menu is about tracks selection and categorization.

Please note that only the non-trivial functions will be commented, otherwise each command is considered self-explanatory!

Main list

Bad tracks

Auxiliary tracks

Tracks analysis

(note that these are currently experimental functions, but you risk nothing by trying/using them!)

Remarks on the tracks analysis:

Markers menu

Don't remember what is a marker, a trigger or an event? or the .mrk marker file format ?

 

Notes on marker files

When all markers have been deleted, the .mrk file associated to the Eeg file will be also deleted. Conversely, when the very first marker is created, the .mrk file is also created.

For security reasons, any time you add or remove any single marker, the .mrk file is immediately updated on disk. This way, in case of any crash, your markers will be securely saved.

Options menu

Scanning for Markers

This is a versatile way to scan tracks for some propertie to generate some markers. The markers generated can either be used for display (i.e. where the interesting parts of the data are), or for later processing (like averaging).

At the end of the chapter, there are a few examples, if you get confused.

 

Scanning methods

There are four methods to scan tracks:

 

The markers resulting from the scan are added to the EEG's associated .mrk file, which you can edit or re-process yourself for more advanced purposes.

There is certainly a trial and error phase before you find the right parameters. It may be a good idea to first select a short time interval and/or only a few tracks before running the scan on the full file. Also don't forget to delete previous markers before re-doing a whole scan, otherwise they will simply cumulate!

Scanning for Markers dialog

What to Scan

 

Tracks:

These are the tracks to analyse.

Each track is analysed independently of the others (except with Template Matching, which operates on maps, i.e. on all tracks at once).

Selecting some tracks from the display before calling this dialog will pre-fill this field.

Time Period:

The time range to scan.

These fields are pre-filled with the current time selection , or the whole time range of the file.

Scanning for

 

Periods of Stability

A track has to remain on a constant level for some time. The level itself does not matter (anything non-zero), the track has just to be constant.

Local Extrema

Finding local minima and/or maxima.

Min

Scan for local minimum.

Use some low-pass filter to reduce the sensitivity / scale of this detection.

See this note.

Max

Scan for local maximum.

Use some low-pass filter to reduce the sensitivity / scale of this detection.

See this note.

Thresholds

A track has to be above or below some threshold.

Note that both above and below criterion can be selected simultaneously. In that case, you end up with an interval testing.

Test if Above:

The track has to be above the specifed value, positive or negative.

Test if Below:

The track has to be below the specifed value, positive or negative.

Set marker position to:

 

First TF past threshold

The marker is strictly inserted at the first TF where the test is found positive.

Highest slope around threshold

The detected position will drift to wherever side which has the highest slope , and will stop there.

The purpose of this option is to help align raising-edge events.

Template Matching

This has to be thought as trying to find a sequence of maps in the data. Tracks are not considered individually, but as a whole pattern (a map). Plus, the maps also evolve in time.

See this note for more details about how template matching is done here.

Template file:

The file with the template to serach for. It should have the same number of electrodes as the EEG file to scan.

It can be any kind of EEG file format.

Correlation above which to accept:

Specifies the correlation value (in percentage) above which the test will be positive.

Correlation does account for sign, that is, correlation -90 is below 50.

Time Constraints

 

Condition has to be true between ... and ... [TF]

Constraint the test chosen by defining time limits.

F.ex. we can be interested in short duration plateau, at least 3 TF longs, but shorter than 30 TF. In case you don't care, set a wide range, like from 1 to 10000!

These fields don't apply to local extrema, which by definition are only 1 TF long.

See this note to visualize how the time constraints work .

Then condition has to be false for ... [TF]

Set the minimum amount of time after the test fails before a new marker can start again. Should be at least 1.

See this note to visualize how the time constraints work .

Simultaneous markers:

Each track can generate its own marker, so we can deal with this.

These options are off when Scanning for a template .

One Marker per Track

Let each simultaneous marker remain that way.

Use the Naming Markers options to help sort out who is who!

Merged into Single Marker

Post-process markers that lie in a given range, and merge them into a single one. See this note.

Also see the Naming Markers  to also merge the names.

Tolerance [TF]

Give a maximum time extent within which "simultaneous" is meant.

Set to 0 to consider only perfectly aligned markers.

Naming Markers

You can tune the markers' name to your liking.

Beginning with Prefix

Optionally start all the markers with this prefix.

By default, it reflects the kind of Scanning method you chose, like "Stab", "Thresh", etc...

Including name

Optionally include the track name.

When Scanning for a template, this is replaced by the Template file name.

Off when merging markers.

Ending with value:

The following options are quite context sensitive!

    None

What it says.

    Track Value

The value of the track that generates the marker at that position.

Useful f.ex. to retrieve the Max value of a track. When Scanning for a template , this is replaced with the Correlation value.

Off when merging markers.

    Relative Index

Add an index corresponding to the relative position of the track generating the marker.

Indexes are not 1, 2, 3, 4... but in powers of 2, like: 1, 2, 4, 8 ... So we can add these values when  merging markers together: f.ex. tracks 3 and 4 together will produce a code of 4 + 8 = 12. If you don't see the use of this, well, just forget it!

Off when Scanning for a template.

    Merged Count

When (and only when) merging markers, add a count of how many markers were doomed to be merged.

Off when Scanning for a template.

Process

Runs the scan.

This button remains disabled until all the parameter dialogs have received enough (and consistent) informations .

Cancel

Quit the dialog.

Help

Launch the Help to the right page (should be here...).

 

Scanning for markers - Technical points & hints

Filtering & reference

The scan is run on the tracks as they appear to you, that is with the current reference and filters. Therefor changing these settings can dramatically affect the markers. This can actually be used for the best, for example when searching for local maxima.

Stopping the scan

Just press Escape to get out of a lengthy detection...

Local Extrema

The detection occurs at the reversal of the signs of 2 successive derivatives.
If there is a plateau on either side, this will make one of the derivative null, therefore no sign inversion can occur (hence no detection).

 

The scan will output every little peaks it finds, which may be too much details for you. In this case, just apply some filters (especially low pass) before running the detection.

Template matching

The vector used to compute the correlation is a big vector made with all the time frames for all the tracks (of the template). F.ex. a template of 100 time frames for 125 electrodes is a vector of 100 * 125 = 12500 dimensions. In this way, we will retrieve only very specific patterns, both in space and in time.

The correlation values does not take into account the power of the signal, but just its shape.

When the current time window first correlates above the threshold, the scan continues and seeks for the highest peak of correlation of the period before the correlation goes below the threshold. Well, sounds difficult to make it in simple words, but simply gives you what you actually expect! The marker position within the selected time window is put where the template has its maximum GFP. In fact, it is not that important, what matters is that the triggers be put at the same offset for all the windows.

The marker position is set at the position of highest GFP. Also see the Naming Markers options.

How the time constraints work

Consider a Stability scan on one track. To create a marker, the condition (plateau) should last within the given limits. Then the next marker can not start before the gap is filled:

 

Condition is false

Condition is true

Condition is false

Condition should last within the time range specified

Gap should be at least this long

 

 



|

|

 

 


| <- Marker insertion

Next marker allowed from here ->

Merging (nearly) simultaneous markers

Merging markers is useful to consolidate the markers resulting from individual tracks into a more synthetic information. We can get the information of how many tracks were successful within a short time range. It can also be used to fusion trigger codes spread across different tracks.

We ran an Above Threshold 0 scan, first without merging markers (i.e. one marker per track, kind of a mess), then with merging markers within 8 TF range (and showing the count of merged markers in the names):

Also see the Naming Markers options.

Scanning for markers - Results

File generated

The markers are added to the external .mrk file associated with the EEG file. Remember to move both files if you move the EEG to another directory.

Scanning for markers - Examples

Here are a few examples to get a grasp on all the possibilities from the combinations of options.

Note however that some options could be hard to understand when combined together . F.ex. scanning for Thresholds Above, plus shifting to the maximum slope, plus merging simultaneous markers with a wide range, plus Naming only with a Prefix... Unless you really want it!

Positions of maximum GFP:

Any track above a value:

Triggers hard-coded into tracks:

Counting frequency events from tracks: