Events and phases


A <phase>-element determines a phase based on a condition formula given as the content of the element. If the value of the formula is bigger than 0, the corresponding frame is part of the phase.

Ether the „condition“ attribute or the attributes „startevent“ and „endevent“ must be used.


Attribute Default Description Required
Name Name of the created phase type, also used as a prefix of created timeseries of condition an value tjaectories. Yes
startEvent Create a phase based on existing start event. Available only for pre- or stepbystep processing. No
endEvent Create a phase based on existing start event. Available only for pre- or stepbystep processing.
phase not used If set to an existing phase and if startEvent/endEvent is not used, a frame es included only if the frame is additionally also included in the given phase. No
process stepbystep Available values: stepbystep, post, pre; The „process phase“, in which the time phase is created. If the condition attribute is used, the condition traj wrapper is calculated step-by-step, but the phases are created also in the postprocess phase. If start-/end-event is used, the phases are created with the first frame. No
value Used only, if process phase == stepbystep and condition is used. Phases created by the condition are excluded, if for the double timeseries defined by this attribute the values are bigger than the value of the maxvalue attribute or smallen than the value of the minvalue attribute. No
contiguous true Used only if startEventTypeName == endEventTypeName. If set to false, an event is used eather as start- or end-event to create non contiguous phases. No
maxvalue Double.MAX_VALUE The timserie defined by the „value“ attribute is tested if it contains a value higher than the value of this attribute. If this is the case the complete phase is excluded. This attribute is respected only, if the process-flag is set to „post“. No
minvalue -Double.MAX_VALUE The timeserie defined by the value attribute is tested, if it contains a value lower than the value of this attribute. If this is the case the complete phase is excluded. This attribute is respected only, if the process-flag is set to „post“. No
minwidth 0 Only phases with more than minwidth frames are created. Phases with less frames are ignored. No
maxwidth Integer.MAX_VALLUE Only phases with less than maxwidth frames are created. Phases with more frames are ignored. No

Calculated Trajectories

Name Type Description
<name>Condition double traj If the child element or the attribute „expr“ (deprecated) is used (set to a formula), the values of this timeseries represents the status of each frame. Zero value indicates not included, else included. Typically the formula defines a function which result in the values 0 and 1 only.
<name>Value double traj If the „value“ attribute is used, this timeserie includes the values of the its formula.

Determined events and phases

Name Description
<name>Global if the attributes startEventType != null and endEventType != null or phaseTypeName != null, than corresponding phases with this name are created and the condition that only frames which are included in these phases are used.


    <Phase name="ABC">abc &gt; 10.0"</Phase>

The following code fragment, creates a phase with minimal width of 10 frames, for frames where the value of the timeserie RShoulderEleDepHDCalDirCosAngle is smaller than 30 degrees.

 <Phase name="REleStart" 
        includes="dynamic_abduk_events">RShoulderEleDepHDCalDirCosAngle &lt; 30.0</Phase>

The following code fragment creates a phases based simply on existing events:

<Phase name="RAbduk" startEvent="RHS" endEvent="RTO" process="post" 


A <Event>-element defines an event, based on the values of a double trajectorie (only), as its child and optional based on a given phase type name.


Attribute Default Description Required
name Name of the created event type, also used as a prefix of created timeseries of condition an value trajectories. Yes
method min „max“, „min“, „minvelocity“, „maxveclocity“ and if the attribute phase is set additional the methods „start“ and „end“ No
process (or deprectaed name calcphase) Vielleicht werde ich überhaupt nur postprocess unterstützten. preprocess und process sind jedenfalls nicht implementiert! process==in the phase, which it processes, step by step No
tolerance If set local maxima/minima are determined by first creating phases with values between global min/max and min*(1+tolerance/100) or max*(1-tolerance/100) No
phase better use tolerance instead if possible Phase type name which defines phases, for each the event is set. No

Determined events and phases

Name Type Description
<name>Intervals phase Phases defined around the trial maximum plus/minus a given tolerance value.
<name> event In each determined phase an event is created at position with max or min value as configured by the method attribute.


<!-- be careful: the event is set to the minimum, that means, that this 
                 position is 90Grad only if this position is reached in the RoM -->
<Event name="ABC"

Notes If the method „minvelocity“ or „maxvelocity“ is used, than a trajectory with the derivation is determined and saved in the trial. But this is a not wanted implementation detail and it will be gone in the future.

If the content is the name of a timeserie only, a classcast exeception is thrown.



A complex example

Have a look at the following plot. It shows an elevation/depression movement with three repetitions:

For all repetitions of the movement in the phase defined by RHS and RTO events the elevation phase should be extracted. The position of RHS is 482 and the position from RTO is 2697.

Have a look at the following code fragment which solves this problem:

<Phase name="REleStartPhase" 
       process="post" minwidth="10"
       startEvent="RHS" endEvent="RTO"
       includes="ShoulderAbdAdd">RShoulderEleDepHDCalDirCosAngle &lt; 30.0</Phase>
<Event name="REleStart" 
       includes="ShoulderAbdAdd" process="post">RShoulderEleDepHDCalDirCosAngle*1.0</Event>   
<Phase name="REleEndPhase" 
       process="post" minwidth="40"
       startEvent="RHS" endEvent="RTO"
       includes="ShoulderAbdAdd">RShoulderEleDepHDCalDirCosAngle &gt; 60.0</Phase>
<Event name="REleEnd" phase="REleEndPhase" method="max"
       includes="ShoulderAbdAdd" process="post">RShoulderEleDepHDCalDirCosAngle*1.0</Event> 
<Phase name="RElePhase" 
       startEvent="REleStart" endEvent="REleEnd" process="post" 
       includes="ShoulderAbdAdd">RShoulderEleDepHDCalDirCosAngle &lt; 90.0</Phase>

The first element defines a phase with name „REleStartPhase“ with the following assumptions:

  • The frames must be inside the phase defined by RHS and RTO event
  • A phase has a minimum length of 10 frames
  • A phase is defined by the condition that the y-values of the curve are less than 30.

This result in two phases: [926;1341], [2156;2618]. You can see the first movement is excluded because of the first assumption.

The element „REleStart“ determines for each of the phases above an event at the position where the curve has its minimum. So we have the start positions of the wanted elevation phases: 1164, 2399

„REleEndPhase“ looks for phases where the y-values of the curve are bigger than 60 and also the assumption defined by RHS and RTO and a min length of 40 frames. „Bigger than 60“ results in the need of a minimum elevation of 60+40=100 degree to autodetect a REleEndPhase.

The interesting thing is that this results in four instead of three phases: [482;836], [1436;1634], [1637;2054] and [2691;2697]. The second phase is split because of a gap in the curve.

The element „REleEnd“ determines the maxima of each of these phases: 523, 1636, 1757, 2697.

From the events „REleStart“ and „REleEnd“ the element „RElePhase“ determines two phases: [2399;2764], [1164;1520]. The nice thing is that the algorithm creates phases without gaps and the additional condition that the phases include frames only if the values of the curve are less than 90 degrees.

To plot these phases you have to add the following code fragment into your sheet definition:

         <Phase name="RElePhase"/>
     <Alignment phase="RElePhase" normalization="RElePhase"/>

modellingcomponents/eventsandphases.txt · Zuletzt geändert: 2018/09/11 18:14 von oliver