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: pattern_surf_plot_mip.m
    path of file: ./repos/CanlabCore/CanlabCore/@image_vector
    
    the code of the file until where you have to start completion: function [mip, x, y, voldata] = pattern_surf_plot_mip(m, varargin)
%
% axial maximum intensity projection pattern surface plot

    
function [mip, x, y, voldata] = pattern_surf_plot_mip(m, varargin)
%
% axial maximum intensity projection pattern surface plot
% needs documentation
%
% voldata is not used, just an output for other processes, e.g., rigid-body
% transformation
%
% m : image_vector (e.g., fmri_data or statistic_image) object
%
% Optional inputs:
% 'nofigure', dofigure = false;
% 'nosmooth', dosmooth = false;
% 'smoothbox', mysmoothbox = varargin{i + 1}; varargin{i + 1} = [];
% 'sd', mygaussstd = varargin{i + 1}; varargin{i + 1} = [];
%
% Tor Wager, 2016
% Update: Aug 2016

% ------------------------------------------------------
% parse inputs
% ------------------------------------------------------
dofigure = true;
dosmooth = true;
mysmoothbox = 5;
sd = 2;

for i = 1:length(varargin)
    if ischar(varargin{i})
        switch varargin{i}
            % reserved keywords
            
            case 'nofigure', dofigure = false;
                
            case 'nosmooth', dosmooth = false;
            case 'smoothbox', mysmoothbox = varargin{i + 1}; varargin{i + 1} = [];
            case 'sd', mygaussstd = varargin{i + 1}; varargin{i + 1} = [];
               
            case 'xlim', xlim = varargin{i + 1}; varargin{i + 1} = [];
            case 'ylim', ylim = varargin{i + 1}; varargin{i + 1} = [];
            case 'zlim', zlim = varargin{i + 1}; varargin{i + 1} = [];
                
                
            case 'noverbose'
                doverbose = false;
                
                %otherwise, warning(['Unknown input string option:' varargin{i}]);
        end