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: ImageRegionalMaxima.m
    path of file: ./repos/ImageM/ImageM/+imagem/+actions/+process
    
    the code of the file until where you have to start completion: classdef ImageRegionalMaxima < imagem.actions.ScalarImageAction
% Extract extended maxima in a grayscale image.
%
%   output = ImageRegionalMaximaAction(input)
%
%   Example
%   ImageRegionalMaximaAct
    
function run(obj, frame) %#ok<INUSL,INUSD>
        % apply regional maxima to current image
        
        % get handle to viewer figure, and current doc
        img = currentImage(frame);
        
        if ~isScalarImage(img)
            warning('ImageM:WrongImageType', ...
                'Regional maxima can be applied only on scalar images');
            return;
        end