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: cat_vol_nlmus.m
    path of file: ./repos/cat12/internal
    
    the code of the file until where you have to start completion: function varargout = cat_vol_nlmus(varargin)
% Non Local Means UpSampling (NLMUS) with Spatial Adaptive Non Local 
% Means (SANLM) Filter.
%
% Filter a set of images and add the prefix 'nlmus_'. Main goal is to  
% restore slice resolution of unisotropic images e.g. to get from 
% 1x1x3 mm3 to 1x1x1 mm3. 
%
% The upsampling does not work on label maps such as the p0*.nii!
%
% Missing input will use defaults. 
%
% Input:
% job    - harvested job data structure (see matlabbatch help)
% 
% Output:
% out    - computation results, usually a struct variable.
%
% cat_vol_sanlm(job)
%   job.data      = set of images 
%   job.prefix    = prefix for filtered images (default = 'nlmus_') 

    
function varargout = cat_vol_nlmus(varargin)
% Non Local Means UpSampling (NLMUS) with Spatial Adaptive Non Local 
% Means (SANLM) Filter.
%
% Filter a set of images and add the prefix 'nlmus_'. Main goal is to  
% restore slice resolution of unisotropic images e.g. to get from 
% 1x1x3 mm3 to 1x1x1 mm3. 
%
% The upsampling does not work on label maps such as the p0*.nii!
%
% Missing input will use defaults. 
%
% Input:
% job    - harvested job data structure (see matlabbatch help)
% 
% Output:
% out    - computation results, usually a struct variable.
%
% cat_vol_sanlm(job)
%   job.data      = set of images 
%   job.prefix    = prefix for filtered images (default = 'nlmus_') 
%   job.rician    = noise distribution
%   job.prefix    = 'nlmus_';
%   job.sanlm     = noise reduction before interpolation
%   job.verb      = display iterations 
%   job.interp    = 1x1 integer gives upsampling value 
%                   1x3 float values gives goal resolution
%                   (default = [1 1 1]); 
%   job.maxiter   = maximum number of iterations (default = 0 = auto)
%   job.writeinit = write simple interpolated image for comparison
%
% Example:
%   cat_vol_nlmus(struct('data','','prefix','us','rician',0));
%
%   The upsampling run intro problems for segment and 

%   cat_vol_nlmus(struct('data','../p0sub.nii','sanlmiter',0, ...
%       'interp','linear');
%
%_______________________________________________________________________
%
%   Robert Dahnke - robert.dahnke@uni-jena.de
%   Center of Neuroimaging 
%   Department of Psychiatry and Psychotherapy 
%   University Hospital Jena
%_______________________________________________________________________
%
%   Jose V. Manjon - jmanjon@fis.upv.es                                     
%   Universidad Politecinca de Valencia, Spain                               
%   Pierrick Coupe - pierrick.coupe@gmail.com                               
%   Brain Imaging Center, Montreal Neurological Institute.                  
%   Mc Gill University                                                      
%                                                                         
%   Copyright (C) 2010 Jose V. Manjon and Pierrick Coupe      
%_______________________________________________________________________
% $Id$

%   job.rf        = round the initial interpolation (10^-2);
%   job.intmeth   = {'spline'|'cubic','linear'} (default = 'spline')

  if nargin == 0 
      job.data = cellstr(spm_select([1 Inf],'image','select images to filter'));
  elseif nargin == 1 && isstruct(varargin{1})
      job = varargin{1};
  else 
      src = varargin{1}; 
      if nargin>1
        if isstruct( varargin{2} )
          job = varargin{2}; 
        else
          job.interp = varargin{2};
        end