Glossary Item Box

NeuroScript MovAlyzeR Help Send comments on this topic.

Segmentation

Segmentation Procedure

The segmentation methods are described on this page for:

I. ScriptAlyzeR and MovAlyzeR

II. GripAlyzeR

I. ScriptAlyzeR and MovAlyzeR

Segmentation consists of 4 levels:

1. Segmentation of multiple writing-pattern recordings into individual words

2. Begin and end detection per writing pattern

3. Stroke segmentation per writing pattern

4. Submovement segmentation per stroke

Segmentation in to words (level 1) is based on raw data. Segmentation levels 2–4 are based on processed data.

There are currently three segmentation methods available in MovAlyzeR to parse the input data in to segments:

The segmentation settings and flags are specified in: Experiment > Experiment settings > Processing > Segmentation > Settings/Flags, in which Various parameters in the calculations can be set.

The phrases highlighted in maroon are the MovAlyzeR terminology used in segmentation settings/flags.

Segmentation by zero crossings of vertical velocity

Movements can be segmented into strokes by zero crossings of the vertical velocity after peak velocity.

Features

o The pattern is segmented into successive up and down strokes.
o This segmentation requires prior (Automatic) and or Fixed Unrotation so that the segmentation dimension will be vertical.
o Fine detection finds the point where the velocity disappears in the noise.
o In theory, minimum absolute vertical velocity coincides with a zero-crossing of the vertical velocity. The converse is not true, because zero-crossing of the vertical velocity may also coincide with a relative maximum of the vertical velocity.
o Linear interpolation is done between the samples around the zero-crossing.

Advantages

o Accurate and simple.
o Easy to chart.
o Only 2 points around zero required.

Disadvantages

o Patterns needs a predominant orientation.
o The predominant orientation needs to be rotated to vertical.

Input data

There are two input files used for segmentation: Raw data (.HWR) and Processed data (.TF). Refer to the section processing movement data for a description of the files.

Algorithm Description

1. Stroke Begin/End Detection:

o Calculate the dynamic range/Velocity level of vertical velocity (Vy) by:

~ Find the maximum/peak Vy, for both positive and negative values.

~ The threshold level considered for segmentation uses the value: Minimum vertical velocity of 1st/last stroke (relative to absolute peak) - Vylev

For example, if minimum is specified as 0.05 (5%) and maximum as 0.1 (10%) then the range is 5% of peak Vy to 10% of peak Vy.

+++Begin point+++

Coarse detection:

o Find the first upward/downward vertical velocity (coarse point), exceeding the threshold level (Vylev), by searching forward from the first sample.

o If the first sample velocity already exceeds Vylev, then search again to find the sample with a velocity value less than Vylev, and to further find the next sample at which velocity exceeds Vylev (threshold).

Fine detection:

o Go backwards from the coarse point until a zero-crossing or minima is found (a).

o In addition, if the option 'Check for the minimum velocity level in cm/s' is checked, go backwards from the coarse point to find the sample at which the velocity is still above the minimum velocity level (b).

o Identify the beginning of first upstroke, which is the latest occuring (highest sample number) among the points (a) and (b).

+++End point+++

 

2. Stroke Segmentation:

o Find all the zero crossings between the first and the last zero-crossing/minima.

o If the last point in the zero-crossing detected is within the minimum stroke duration, then add another point at the last zero-crossing/minima.

Note: If the time duration between adjacent zero-crossings is less than the minimum stroke duration, then the last segmentation point for that stroke is not considered.

o Remove first segmentation point, if starting with non-zero vertical velocity except when there is only begin and end. Do not remove first point if it is at a velocity level smaller than the second threshold level as specified by: Maximum vertical velocity of 1st/last stroke (relative to absolute peak).

~ For example, if the maximum vertical velocity is specified as 0.10 (10%), the first point is not removed by the procedure above if at a level lesser than 10% of the peak vertical velocity.

o Remove last segmentation point, if stopping within non-zero vertical velocity except when there is only begin and end.

o Calculate the minimum stroke size and remove the strokes (corresponding segmentation points) which are smaller than this size by:

~ Use the value specified in settings for 'Minimum stroke size relative to max stroke' (ratio of Minimum stroke length/Length of longest stroke).

~ Tentative minimum stroke length = (Length of longest stroke in a trial) * value of ratio specified in settings.

~ Then actual minimum stroke size = Maximum of (Minimum stroke size from segmentation settings, Tentative minimum stroke length).

~ Example,
Minimum stroke size relative to max stroke ratio specified = 0.1 (10%)
If the length of maximum stroke in a trial is 10 cm, then the tentative minimum stroke length is 0.1*10 = 1 cm.
If the minimum stroke size specified = 0.05 cm, then the actual minimum stroke size = max (1, 0.05) = 1 cm.

~ Note: In this case, then all the strokes with lengths less than 1 cm are ignored. Hence, in a trial if there is an indication there are some strokes missing or unduly terminated, then verify that the ratio is not too large and adjust the value accordingly. The lower the %(ratio), the more zero crosssings (segmentation points) are considered.

3. Conditional processing based on segmentation flags set:

o If the option 'Add Last Segment at any rate' in segmentation flags is checked, then:

~ Add a last point (and a corresponding stroke) at the last data value, if there is data after the current last segmentation point, irrespective of the min/max velocity relative to peak, specified.

o If the option 'Add First Segment at any rate' in segmentation flags is checked, then:

~ Add a first point (and a corresponding stroke) at the first data value, if there is data before the current first segmentation point, irrespective of the specified min/max velocity relative to peak velocity.

o If the option 'One Stroke analysis' in segmentation flags is checked, then:

~ Add a first point (and a corresponding stroke) at the first data value, if there is data before the current first segmentation point.

o If option (2), replace the first and last segmentation points with the acceleration zero crossing points determined earlier (in case they were replaced/altered during intermediate processing)

o MovAlyzeR ONLY: If the option 'Submovement analysis' in segmenation flags is checked, then:

~ Determine the secondary submovement points for every stroke (The first minima after the velocity peak in that stroke).

o Write the primary and submovement points, if any, to the output file.

Output data

Output data for segmentation consists of:

Segmentation points:

tvyzero (sec): The time in sec corresponding to the primary segmentation points (vertical velocity zero crossings). Two of these adjacent points make up a stroke.

If option (2), first and last point refer to vertical velocity minima instead.

Secondary submovement points (MovAlyzeR ONLY + submovement analysis checked):

tayzero (sec): The time in sec corresponding to the secondary submovement points for every stroke. Hence, each of these points will have a value inbetween the current and next segmentation points. Eg., the first secondary submovement point value will be inbetween consecutive segmentation points.

For more details, refer to the section processing movement data for a description of the files.

Example:

Red circle points show vertical velocity zero crossings (strokes) and cross points show submovement points

For a x-y data pattern as given below:

The Vertical velocity data chart will be as follows:


Segmentation at the local minima of absolute velocity

Movements can also be segmented into strokes by minima of the absolute velocity. The time accuracy of the segmentation points has been improved by quadratic interpolation between three samples: the sample of the minimum and the 2 adjacent samples.

Features

o Does not require that a pattern has one particular orientation.
o Strokes do not need to have an up-down sequence.
o Quadratic interpolation is done around the minimum sample.

Quadratic Interpolation: Interpolation in the time domain is essential to achieve the required accuracy. For example, measuring a very short time interval, e.g., between samples 116 and 120, would yield 4 samples if no interpolation were applied. With interpolation, the sample numbers cold be 116.3 and 119.6, yielding an interval of 3.3, which is substantially different and most likely better.

Advantages

o Orientation free

Disadvantages

o Less accurate due to quadratic approximation.

o Less trivial to chart (charts interpolate still linearly but the x-coordinate of the segmentations are taken from the quadratically interpolated minima and may seem higher than the lowest sample)

Input data

There are two input files used for segmentation: Raw data (.HWR) and Processed data (.TF). Refer to the section processing movement data for a description of the files.

Algorithm Description

1. Stroke Begin/End Detection:

o Calculate the dynamic range/Velocity level of absolute velocity (Vabs) by:

~ Find the maximum/peak of Vabs, for both positive and negative values.

~ Find the range of Vabs levels considered for segmentation using the value: Minimum vertical velocity of 1st/last stroke (relative to absolute peak)- Vlev.

Note: In above, the 'vertical velocity' term is taken as absolute velocity for this segmentation method.

~ For example, if minimum is specified as 0.05 (5%) and maximum as 0.1 (10%) then the range is 5% of peak Vabs to 10% of peak Vabs.

Coarse detection:

Find the first upward/downward absolute velocity (coarse point), exceeding the threshold level (Vlev), by searching forward from the first sample for begin point detection, and last sample for the end point detection.

Fine detection - Begin point:

Identify the beginning of first upstroke, by going backwards from the coarse point until a minima is found.

Fine detection - End point:

Identify the ending of last stroke by searching forwards from the coarse point until a minima is found.

2. Stroke Segmentation:

o Find all the minima between the first and the last points.

o If the last point in the minima detected is within the minimum stroke duration, then add another point at the last minima.

Note: If the time duration between the adjacent minima is less than the minimum stroke duration, then the ending segmentation point for that stroke is not considered.

o Remove first segmentation point, if starting with non-zero absolute velocity except when there is only begin and end. Do not remove first point if it is at a velocity level smaller than the second threshold level as specified by setting: Maximum vertical velocity of 1st/last stroke (relative to absolute peak). Here, the term vertical velocity refers to absolute velocity for this segmentation method.

~ For example, if the maximum vertical velocity is specified as 0.10 (10%), the first point is not removed by the procedure above if it is at a level lesser than 10% of the peak vertical velocity.

o Remove last segment if stopping with non-zero absolute velocity except when there is only begin and end.

o Calculate the minimum stroke size and remove the strokes (corresponding segmentation points) which are smaller than this size by:

~ Use the value specified in settings for 'Minimum stroke size relative to max stroke' (ratio of Minimum stroke length/Length of longest stroke).

~ Tentative minimum stroke length = (Length of longest stroke in a trial) * value of ratio specified in settings.

~ Then actual minimum stroke size = Maximum of (Minimum stroke size from segmentation settings, Tentative minimum stroke length).

~ Example,
Minimum stroke size relative to max stroke ratio specified = 0.1 (10%)
I f the length of maximum stroke in a trial is 10 cm, then the tentative minimum stroke length is 0.1*10 = 1 cm.
If the minimum stroke size specified = 0.05 cm, then the actual minimum stroke size = max (1, 0.05) = 1 cm.

~ Note: In this case, then all the strokes with lengths less than 1 cm are ignored. Hence, in a trial if there is an indication there are some strokes missing or unduly terminatedl, verify that the ratio is not too large and adjust the value accordingly. The lower the %(ratio), the more minima (segmentation points) are considered.

3.Conditional processing based on segmentation flags set:

o If the option 'Add Last Segment at any rate' in segmenation flags is checked, then:

~ Add a last point (and a corresponding stroke) at the last data value, if there is data after the current last segmentation point, irrespective of the specified min/max velocity relative to peak velocity.

o If the option 'Add First Segment at any rate' in segmentation flags is checked, then:

~ Add a first point (and a corresponding stroke) at the first data value, if there is data before the current first segmentation point, irrespective of the specified min/max velocity relative to peak velocity.

o If the option 'One Stroke analysis' in segmenation flags is checked, then:

~ Add a first point (and a corresponding stroke) at the first data value, if there is data before the current first segmentation point.

o MovAlyzeR ONLY: If the option 'Submovement analysis' in segmenation flags is checked, then:

~ Determine the secondary submovement points for every stroke (The first minima after the velocity peak in that stroke).

o Write the primary and submovement points (if any) to the output file.

Output data

Output data for segmentation consists of:

Primary segmentation points:

tvabsmin (sec): The time in sec corresponding to the segmentation points (absolute velocity minima). Two of these adjacent points make up a stroke.

Secondary submovement points (MovAlyzeR ONLY + submovement analysis checked):

tvabssec (sec): The time in sec corresponding to the secondary submovement points for every stroke. Hence, each of these points will have a value inbetween the current and next segmentation points. e.g., the first submovement point value will be inbetween the first and second segmentation point values.

For more details, refer to the section processing movement data for a description of the files.

Example:

Red circle points show absolute velocity minima and cross points show submovement points.

For the slow pattern shown below, using the default settings would yield many more segmentation points (points at all the velocity minima). Here, the minimum stroke duration setting in experiment settings, was increased to 0.3 s, to yield the up and downstrokes as shown below:

 

The absolute velocity chart will be as follows:

Summary:

Segmentation consists of 4 levels:
1. Word segmentation of multi-writing-pattern recordings
2. Begin and end detection per writing pattern
3. Stroke segmentation per writing pattern
4. Submovement segmentation per stroke

Segmentation 1. is based on raw data
Segmentations 2–4 assume are based on processed data

Vertical Velocity

1. Begin/End Detection:

Coarse Detection: First search coarsely from begin and end of the recording for a point where the absolute value increases above, or drops below, respectively, the Minimum Velocity Level relative to the absolute peak (threshold velocity).

If the inital or final sample already exceeds Maximum Velocity, then search first for the sample with an absolute value less than threshold velocity.

Fine Detection: This finds the point where the velocity disappears in the noise by searching in opposite direction where velocity drops below threshold. Then continue searching for the FIRST occurrence of
o Zero crossing of the vertical velocity
o Relative minimum of the absolute vertical velocity, thus closest to zero.

2. Stroke Segmentation

o Find all zero crossings
o Remove a zero crossing closer than the Minimum Stroke Size from the previous segmentation point.
o Remove a zero crossing closer than the Minimum Stroke Duration from the previous segmentation point.
o Remove a zero crossing if the next stroke has the same direction (up or down) as the current stroke.

3. Conditional processing based on segmentation flags set, including add first/last segment and submovement analysis.

Absolute Velocity Segmentation

1. Begin/End Detection:

Coarse Detection: First search coarsely from begin and end of the recording for a point where the value increases above, or drops below, respectively, the minimum velocity level relative to peak (threshold).

Fine Detection: Then search in opposite direction for the first occurrence of minima.

2. Stroke Segmentation

o Find all minima
o Remove a minimum closer than the Minimum Stroke Size from the previous segmentation point.
o Remove a minimum closer than the Minimum Stroke Duration from the previous segmentation point.

3. Conditional processing based on segmentation flags set, including add first/last segment and submovement analysis

 


Segmentation at Pendown Trajectories

All continuous pendown points without a single penup in between are collected as one segment.


II. GripAlyzeR

The gripper data segmentation is based on the z value from raw data (Load force in N/Volts/raw units)

Notes

The previously described segmentation flags and settings are NOT applicable in the case of gripper.

GripAlyzeR always yields 5 segmentation points spanning the following 4 phases:

Phase 1: Preload
o The load force as well as the upper and lower grip forces are relatively stable.
o The first few samples (adjustable) are used to calibrate baseline forces.
o The left hand grabs the bottom unit. The LowerGrip force increases.
o The right hand grabs the top unit. The UpperGrip force increases.
o The load force may show increases or decreases, depending on how stable the participant is.
o This phase starts at the beginning of the recording.

Phase 2: Load
o The participant tries to pull the two units apart while a programmable magnet remains active until a certain pulling (load) force. The Load force increases.
o When the load force exceeds the preset magnet force, the electromagnet is repolarized so that it detaches instantly. This method allows to precisely control the magnetic force.
o This phase starts when the measurable load force increases beyond noise level.

Phase 3: Post lift-off
o The load force drops dramatically to zero level.
o This phase starts when the load force has reached its peak value during the entire recording.

Phase 4: Recovery
o The load force will oscillate around the stable zero level.
o This phase starts when the dramatical drop in load force reaches noice level.
o The end of the recovery phase is the end of the recording.

Input data

Raw data file (.FRD) is used in segmentation. Refer to the section processing movement data for a description of the files.

Algorithm Description

1. Add begin point of preload phase

Add a first point (and a corresponding stroke) at the first sample.

2. Detect begin of load phase

Coarse Detection: First search coarsely from begin of the recording for a point where the value increases above the threshold velocity level relative to peak velocity.

Fine Detection: Then search backwards for the first occurrence of zero crossing or minimum.

3. Detect end of post lift off/begin of recover phase

Coarse Detection: First search coarsely from end of the recording for a point where the value increases above the threshold velocity level relative to peak velocity.

Fine Detection: Then search forwards for the first occurrence of zero crossing or minimum.

4. Detect Positive peak

Find the highest positive peak between the begin and end of load phase points from steps 2. and 3.

5. Add end point of recover phase

Add a last point (and a corresponding stroke) at the last sample.

Output data

Output data for segmentation consists of:

tseg(sec): The time in sec corresponding to the five segmentation points as described in notes

 

 

 


© NeuroScript LLC. All Rights Reserved.