def filter_out_outer_values(data, stroke_label, length_factor):
    """Filters out from the data the values that don't belong inside the
    wear track's central region. That region is defined by length_factor as
    a fraction of the wear track's length.

    INPUT:
        data: DataFrame.

        stroke_label: string, label of the stroke column in data.

        length_factor: float between 0.0 and 1.0.

    OUTPUT:
        DataFrame

    EXAMPLE:
        A length factor of 0.1 applied on a stroke length of 10 mm will filter
        out all values outside of  0.1 * 10 mm / 2 = 0.5 mm around the
        weartrack's center.
    """
    max_filter_limit = data.loc[:, stroke_label].max() * length_factor / 2
    min_filter_limit = data.loc[:, stroke_label].min() * length_factor / 2

    central_values = ((data.loc[:, stroke_label] <= max_filter_limit) &
                      (data.loc[:, stroke_label] >= min_filter_limit))

    return data.loc[central_values].copy()