You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ImageAutoThresholdOtsu.m
    path of file: ./repos/ImageM/ImageM/+imagem/+actions/+process
    
    the code of the file until where you have to start completion: classdef ImageAutoThresholdOtsu < imagem.actions.ScalarImageAction
% Threshold image using Otsu method.
%
%   output = ImageAutoThresholdOtsuAction(input)
%
%   Example
%   ImageAutoThresholdOtsuAction
%
%   See also
%

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2012-04-17,    using Matlab
    
function run(obj, frame) %#ok<INUSL,INUSD>

        % get handle to current doc
        doc = currentDoc(frame);
        
        % apply 'gradient' operation
        bin = otsuThreshold(doc.Image);
        
        % add image to application, and create new display
        newDoc = addImageDocument(frame, bin);
        
        % add history
        string = sprintf('%s = otsuThreshold(%s);\n', newDoc.Tag, doc.Tag);
        addToHistory(frame, string);

    end