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: bfsl_motion_outliers.m
    path of file: ./repos/bspm/fsl
    
    the code of the file until where you have to start completion: function cmd = bfsl_motion_outliers(epi, TR, varargin)

    
function cmd = bfsl_motion_outliers(epi, TR, varargin)
    %  USAGE: bfsl_motion_outliers(epi, varargin);
    %
    %  metric: 'refrms', 'dvars', 'refmse', 'fd', 'fdrms'
    % __________________________________________________________________________
    % Usage: fsl_motion_outliers -i <input 4D image> -o <output confound file> [options]
    %
    % Options:
    %      -m <mask image>      use supplied mask image for calculating metric
    %      -s <filename>        save metric values (e.g. DVARS) as text into specified file
    %      -p <filename>        save metric values (e.g. DVARS) as a graphical plot (png format)
    %      -t <path>            [Optional] Path to the location where temporary files should be created. Defaults to /tmp
    %      --refrms             use RMS intensity difference to reference volume as metric [default metric]
    %      --dvars              use DVARS as metric
    %      --refmse             Mean Square Error version of --refrms
    %      --fd                 use FD (framewise displacement) as metric
    %      --fdrms              use FD with RMS matrix calculation as metric
    %      --thresh=<val>       specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR)
    %      --nomoco             do not run motion correction (assumed already done)
    %      --dummy=<val>        number of dummy scans to delete (before running anything and creating EVs)
    %      -v                   verbose mode
    %
    def = {
    'include_rp', 1,             ...
    'makeplot',   0,             ...
    'maskfile',   [],            ...
    'metric',     'refrms',      ...
    'nomoco',     true,          ...
    'prefix',     'fslbadscan',  ...
    'saveraw',    0,             ...
    'thresh',     'auto',        ...
    };
    vals = setargs(def, varargin);
    if nargin < 1, mfile_showhelp; fprintf('\t| - VARARGIN DEFAULTS - |\n'); disp(vals); return; end