              textvariable=self._globals.tk_filter_mode,
              state="readonly",
              values=self._filter_modes)
          combo.pack(side=tk.RIGHT)
          return nav_frame
  
      def cycle_filter_mode(self):
          """ Cycle the navigation mode combo entry """
          current_mode = self._globals.filter_mode
          idx = (self._filter_modes.index(current_mode) + 1) % len(self._filter_modes)
 
</s> remove         """ Add the navigation mode combo box to the transport frame """
 </s> add         """ Add the navigation mode combo box to the filter frame.

        Parameters
        ----------
        frame: :class:`tkinter.ttk.Frame`
            The Filter Frame that holds the filter combo box
        """ </s> remove         return ["All Frames", "Has Face(s)", "No Faces", "Multiple Faces"]
 </s> add         return ["All Frames", "Has Face(s)", "No Faces", "Multiple Faces", "Misaligned Faces"] </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                 b_image = encode_image(aligned.face, extension, metadata=meta)
                saver.save(output, b_image)
        saver.close()
 </s> add                 b_image = encode_image(aligned.face, ".png", metadata=meta)
                _io["saver"].save(output, b_image)
        _io["saver"].close()
        Tooltip(nav_frame, text=self._helptext["mode"])
        nav_frame.pack(side=tk.RIGHT)

    def _add_filter_threshold_slider(self, frame):
        """ Add the optional filter threshold slider for misaligned filter to the filter frame.

        Parameters
        ----------
        frame: :class:`tkinter.ttk.Frame`
            The Filter Frame that holds the filter threshold slider
        """
        slider_frame = ttk.Frame(frame)
        tk_var = self._globals.tk_filter_distance

        min_max = (5, 20)
        ctl_frame = ttk.Frame(slider_frame)
        ctl_frame.pack(padx=2, side=tk.RIGHT)

        lbl = ttk.Label(ctl_frame, text="Distance:", anchor=tk.W)
        lbl.pack(side=tk.LEFT, anchor=tk.N, expand=True)

        tbox = ttk.Entry(ctl_frame, width=6, textvariable=tk_var, justify=tk.RIGHT)
        tbox.pack(padx=(0, 5), side=tk.RIGHT)

        ctl = ttk.Scale(
            ctl_frame,
            variable=tk_var,
            command=lambda val, var=tk_var, dt=int, rn=1, mm=min_max:
            set_slider_rounding(val, var, dt, rn, mm))
        ctl["from_"] = min_max[0]
        ctl["to"] = min_max[1]
        ctl.pack(padx=5, fill=tk.X, expand=True)
        for item in (tbox, ctl):
            Tooltip(item,
                    text=self._helptext["distance"],
                    wrap_length=200)
        tk_var.trace("w", self._navigation.nav_scale_callback)
        self._optional_widgets["distance_slider"] = slider_frame

    def pack_threshold_slider(self):
        """ Display or hide the threshold slider depending on the current filter mode. For
        misaligned faces filter, display the slider. Hide for all other filters. """
        if self._globals.tk_filter_mode.get() == "Misaligned Faces":
            self._optional_widgets["distance_slider"].pack(side=tk.LEFT)
        else:
            self._optional_widgets["distance_slider"].pack_forget()
              textvariable=self._globals.tk_filter_mode,
              state="readonly",
              values=self._filter_modes)
          combo.pack(side=tk.RIGHT)
        Tooltip(nav_frame, text=self._helptext["mode"])
        nav_frame.pack(side=tk.RIGHT)

    def _add_filter_threshold_slider(self, frame):
        """ Add the optional filter threshold slider for misaligned filter to the filter frame.

        Parameters
        ----------
        frame: :class:`tkinter.ttk.Frame`
            The Filter Frame that holds the filter threshold slider
        """
        slider_frame = ttk.Frame(frame)
        tk_var = self._globals.tk_filter_distance

        min_max = (5, 20)
        ctl_frame = ttk.Frame(slider_frame)
        ctl_frame.pack(padx=2, side=tk.RIGHT)

        lbl = ttk.Label(ctl_frame, text="Distance:", anchor=tk.W)
        lbl.pack(side=tk.LEFT, anchor=tk.N, expand=True)

        tbox = ttk.Entry(ctl_frame, width=6, textvariable=tk_var, justify=tk.RIGHT)
        tbox.pack(padx=(0, 5), side=tk.RIGHT)

        ctl = ttk.Scale(
            ctl_frame,
            variable=tk_var,
            command=lambda val, var=tk_var, dt=int, rn=1, mm=min_max:
            set_slider_rounding(val, var, dt, rn, mm))
        ctl["from_"] = min_max[0]
        ctl["to"] = min_max[1]
        ctl.pack(padx=5, fill=tk.X, expand=True)
        for item in (tbox, ctl):
            Tooltip(item,
                    text=self._helptext["distance"],
                    wrap_length=200)
        tk_var.trace("w", self._navigation.nav_scale_callback)
        self._optional_widgets["distance_slider"] = slider_frame

    def pack_threshold_slider(self):
        """ Display or hide the threshold slider depending on the current filter mode. For
        misaligned faces filter, display the slider. Hide for all other filters. """
        if self._globals.tk_filter_mode.get() == "Misaligned Faces":
            self._optional_widgets["distance_slider"].pack(side=tk.LEFT)
        else:
            self._optional_widgets["distance_slider"].pack_forget()
  
      def cycle_filter_mode(self):
          """ Cycle the navigation mode combo entry """
          current_mode = self._globals.filter_mode
          idx = (self._filter_modes.index(current_mode) + 1) % len(self._filter_modes)
keep keep keep keep replace 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/frame.py