dispel.providers.generic.flags.le_flags module#

A module to store the lower extremity (le) related flags.

dispel.providers.generic.flags.le_flags.END_POSTURAL_ADJUSTMENT = 5#

Time of end of postural adjustment in seconds.

class dispel.providers.generic.flags.le_flags.ExcessiveMotionFlagger[source]#

Bases: FlagLevelStep

Flag minimum length of valid recording without excessive motion.

acceptance_threshold: float = 0.0#
flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

start_time: float = 0#
class dispel.providers.generic.flags.le_flags.ExcessiveTurns[source]#

Bases: FlagLevelStep

Flag record with at least a pre-specified number of turns per minute.

__init__(acceptance_threshold=3, *args, **kwargs)[source]#
Parameters:

acceptance_threshold (float) –

flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

class dispel.providers.generic.flags.le_flags.FlagAdjustmentNonBeltSBT[source]#

Bases: NonBeltPostAdjustmentDetected

Flag SBT records with non-belt post-adjustment period.

acceptance_threshold: float = 0#
placements: list = []#
class dispel.providers.generic.flags.le_flags.FlagNonBeltSBT[source]#

Bases: NonBeltDetected

Flag SBT records with non-belt period greater than threshold.

acceptance_threshold: float = 0#
placements: list = []#
class dispel.providers.generic.flags.le_flags.FlagPostAdjustExcessiveMotion[source]#

Bases: ExcessiveMotionFlagger

Flag minimum length of valid recording without excessive motion.

__init__(**kwargs)[source]#
flag_name: AV | str = Excessive Motion Detected during Stabilisation (excessive_motion)#

The name of the flag

reason: str = '{excessive_motion_portion}% excessive motion portion detected (exceeds {acceptance_threshold}% accepted)'#

The detailed reason of the flag

class dispel.providers.generic.flags.le_flags.FlagStabilisationExcessiveMotion[source]#

Bases: ExcessiveMotionFlagger

Flag minimum length of valid recording without excessive motion.

__init__(**kwargs)[source]#
flag_name: AV | str = Excessive Motion Detected Post-adjustment (excessive_post_adjustment_motion)#

The name of the flag

reason: str = '{excessive_motion_portion:.1f}% excessive motion post-adjustment portion detected (exceeds {acceptance_threshold}% accepted)'#

The detailed reason of the flag

class dispel.providers.generic.flags.le_flags.LargeTurnsPerMinute[source]#

Bases: ExtractStep

Extract rate of large turns used in rectilinear walking bout detection.

data_set_ids: str | Iterable[str] = ['gyroscope_ts_rotated_resampled_butterworth_low_pass_filter_x_turns', 'accelerometer']#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

static large_turns_per_min(turns, acc)[source]#

Compute number of large turns per minute.

Parameters:
Return type:

float

dispel.providers.generic.flags.le_flags.MAX_FRACTION_EXCESSIVE_MOTION = 0.0#

The maximum fraction of excessive motion over the total duration of the assessment.

dispel.providers.generic.flags.le_flags.MAX_GAIT_PERC_NOT_IN_BELT = 10#

Maximum percentage allowed not in belt for Gait.

dispel.providers.generic.flags.le_flags.MAX_PERC_NOT_MOVING = 10#

Maximum percentage of level duration allowed not moving.

dispel.providers.generic.flags.le_flags.MAX_PERC_NOT_RECTILINEAR_BELT_WALK = 10#

Maximum percentage of level duration allowed not rectilinear on-belt walking.

dispel.providers.generic.flags.le_flags.MAX_SBT_PERC_NOT_IN_BELT = 0#

Maximum percentage allowed not in belt for SBT assessment.

dispel.providers.generic.flags.le_flags.MAX_TURNS_PER_MIN = 3#

Maximum number of turns per minute allowed.

class dispel.providers.generic.flags.le_flags.NoMovementDetected[source]#

Bases: FlagLevelStep

Flag record with at least a pre-specified percentage of non-movement.

__init__(acceptance_threshold=10, *args, **kwargs)[source]#
Parameters:

acceptance_threshold (float) –

flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

class dispel.providers.generic.flags.le_flags.NoTurnsDetected[source]#

Bases: FlagLevelStep

Flag record with no turns present.

flag_name: AV | str = No turns detected. (no_turns_detected)#

The name of the flag

flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

reason: str = 'At least 1 turn should be detected.'#

The detailed reason of the flag

class dispel.providers.generic.flags.le_flags.NonBeltDetected[source]#

Bases: FlagLevelStep

Flag record with non-belt period greater than threshold.

flag_name: AV | str = {non_belt_portion}% was detected at {placements} (more than the{acceptance_threshold}% accepted) (non_belt_greater_than_{acceptance_threshold}_perc)#

The name of the flag

flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

reason: str = '{non_belt_portion}% non-belt portion detected at {placements} (exceeds {acceptance_threshold}% accepted)'#

The detailed reason of the flag

class dispel.providers.generic.flags.le_flags.NonBeltDetected6MWT[source]#

Bases: NonBeltDetected

Flag gait record with non-belt period greater than threshold.

__init__(acceptance_threshold=10, *args, **_kwargs)[source]#
Parameters:

acceptance_threshold (float) –

class dispel.providers.generic.flags.le_flags.NonBeltDetectedUTT[source]#

Bases: NonBeltDetected

Flag gait record with non-belt period greater than threshold.

__init__(acceptance_threshold=10, *args, **kwargs)[source]#
Parameters:

acceptance_threshold (float) –

class dispel.providers.generic.flags.le_flags.NonBeltPostAdjustmentDetected[source]#

Bases: FlagLevelStep

Flag record with non-belt period greater than threshold.

flag_name: AV | str = {non_belt_portion}% (more than the {acceptance_threshold}% accepted) was detected post-adjustment at {placements} (non_belt_post_adjustment_greater_than_{acceptance_threshold}_perc)#

The name of the flag

flag_severity: FlagSeverity | str = 2#
flag_type: FlagType | str = 2#

The type of the flag

reason: str = '{non_belt_portion}% non-belt post-adjustment portion detected at {placements} (exceeds {acceptance_threshold}% accepted)'#

The detailed reason of the flag

class dispel.providers.generic.flags.le_flags.NotEnoughRectilinearWalkingOnBeltDetected[source]#

Bases: FlagLevelStep

Flag record containing less than a % of rectilinear walking on belt.

__init__(acceptance_threshold=10, *args, **_kwargs)[source]#
Parameters:

acceptance_threshold (float) –

flag_severity: FlagSeverity | str = 1#
flag_type: FlagType | str = 2#

The type of the flag

class dispel.providers.generic.flags.le_flags.PercentageNotMoving[source]#

Bases: ExtractStep

Extract percentage of recording where no walking is detected..

data_set_ids: str | Iterable[str] = ['movement_bouts']#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

static no_movement_period(df_walking, **_kwargs)[source]#

Compute percentage of non moving portion of the signal.

Parameters:

df_walking (DataFrame) –

Return type:

bool

class dispel.providers.generic.flags.le_flags.PercentageNotWalking[source]#

Bases: ExtractStep

Extract percentage of recording where no walking is detected..

data_set_ids: str | Iterable[str] = ['walking_placement_no_turn_bouts']#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

static no_walking_period(df_walking, **_kwargs)[source]#

Compute percentage of non walking portion of the signal.

Parameters:

df_walking (DataFrame) –

Return type:

bool

class dispel.providers.generic.flags.le_flags.PlacementClassificationGroup[source]#

Bases: ProcessingStepGroup

A ProcessingStepGroup concatenating PlacementClassificationGroup steps.

steps: List[ProcessingStep] = [<dispel.providers.generic.sensor.Resample object>, <dispel.providers.generic.sensor.EuclideanNorm object>, <dispel.providers.generic.activity.placement.ClassifyPlacement object>]#
dispel.providers.generic.flags.le_flags.START_TIME_ASSESSMENT = 0#

Time of start of the assessment in seconds.

class dispel.providers.generic.flags.le_flags.TruncateFirst5Turns[source]#

Bases: TransformStep

Truncate UTT placement_bouts to keep only the first 5 turns.

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: start_time (start time)>, <RawDataValueDefinition: end_time (end time)>, <RawDataValueDefinition: duration (duration)>, <RawDataValueDefinition: placement (detected placement)>]#
get_new_data_set_id()[source]#

Suffix new_data_set_id with current data_set_id & first_5_turns.

Return type:

str

dispel.providers.generic.flags.le_flags.perc_excessive_motion(level, data_set_id='flagged_motion', thrs_start=0)[source]#

Return excessive motion percentage.

Parameters:
Return type:

float

dispel.providers.generic.flags.le_flags.perc_non_belt(level, data_set_id='placement_bouts', start_time=0)[source]#

Return non belt percentage and placements.

Parameters:
Return type:

Tuple[float, list]

dispel.providers.generic.flags.le_flags.percentage_off_bouts(data, **_kwargs)[source]#

Compute percentage of non-moving portion of the signal.

Parameters:

data (DataFrame) –

Return type:

bool

dispel.providers.generic.flags.le_flags.truncate_first_5_turns(data, turns)[source]#

Truncate the data frame to keep first 5 turns.

Parameters:
Return type:

DataFrame

dispel.providers.generic.flags.le_flags.truncate_placement(df_placement, threshold_start)[source]#

Truncate placement_bouts before threshold_start.

Parameters:
Return type:

DataFrame

dispel.providers.generic.flags.le_flags.truncate_signal(signal, thrs_start)[source]#

Truncate signal before threshold_start.

Parameters:
Return type:

DataFrame