def ms_cutall(self, viewer, event, data_x, data_y):
        """An interactive way to set the low AND high cut levels.
        """
        if not self.cancut:
            return True

        x, y = self.get_win_xy(viewer)

        if event.state == 'move':
            self._cutboth_xy(viewer, x, y)

        elif event.state == 'down':
            self._start_x, self._start_y = x, y
            image = viewer.get_image()
            #self._loval, self._hival = viewer.get_cut_levels()
            self._loval, self._hival = viewer.autocuts.calc_cut_levels(image)

        else:
            viewer.onscreen_message(None)
        return True
def ms_cutall ( self , viewer , event , data_x , data_y ) : if not self . cancut : return True x , y = self . get_win_xy ( viewer ) if event . state == 'move' : self . _cutboth_xy ( viewer , x , y ) elif event . state == 'down' : self . _start_x , self . _start_y = x , y image = viewer . get_image ( ) self . _loval , self . _hival = viewer . autocuts . calc_cut_levels ( image ) else : viewer . onscreen_message ( None ) return True
An interactive way to set the low AND high cut levels.