          frame_count = self._det_faces.filter.count
          if self._current_nav_frame_count == frame_count:
              logger.trace("Filtered count has not changed. Returning")
              return False
          max_frame = max(0, frame_count - 1)
          logger.debug("Filtered frame count has changed. Updating from %s to %s",
                       self._current_nav_frame_count, frame_count)
          self._nav["scale"].config(to=max_frame)
          self._nav["label"].config(text="/{}".format(max_frame))
 
</s> remove         """ Adjust transport slider scale for different filters.
 </s> add         """ Adjust transport slider scale for different filters. Hide or display optional filter
        controls. </s> remove         faces.extend(deepcopy(self._faces_at_frame_index(idx)))
 </s> add         # aligned_face cannot be deep copied, so remove and recreate
        to_copy = self._faces_at_frame_index(idx)
        for face in to_copy:
            face.aligned = None
        copied = deepcopy(to_copy)

        for old_face, new_face in zip(to_copy, copied):
            old_face.load_aligned(None)
            new_face.load_aligned(None)

        faces.extend(copied)
        if self._globals.tk_filter_mode.get() == "Misaligned Faces":
            self._det_faces.tk_face_count_changed.set(True)
          frame_count = self._det_faces.filter.count
          if self._current_nav_frame_count == frame_count:
              logger.trace("Filtered count has not changed. Returning")
              return False
        if self._globals.tk_filter_mode.get() == "Misaligned Faces":
            self._det_faces.tk_face_count_changed.set(True)
          max_frame = max(0, frame_count - 1)
          logger.debug("Filtered frame count has changed. Updating from %s to %s",
                       self._current_nav_frame_count, frame_count)
          self._nav["scale"].config(to=max_frame)
          self._nav["label"].config(text="/{}".format(max_frame))
keep keep keep add keep keep keep keep keep
 Add Misalignment Detection
  - lib.align.AlignedFace - Add average_distance property (distance from mean_face)
  - tools.manual - Add misaligned Faces filter
  - tools.sort - Add sort by distance (misaligned sort)Add "Misaligned Faces" filter to manual tool 
tools/manual/frameviewer/control.py