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: volumesmooth.m
    path of file: ./repos/bspm/thirdparty/spm12/external/fieldtrip/utilities/private
    
    the code of the file until where you have to start completion: function [output] = volumesmooth(input, fwhm, str)

% VOLUMESMOOTH is a helper function for segmentations
%
% See also VOLUMETHRESHOLD, VOLUMEFILLHOLES

% ensure that SPM is available, needed for spm_smooth

    
function [output] = volumesmooth(input, fwhm, str)

% VOLUMESMOOTH is a helper function for segmentations
%
% See also VOLUMETHRESHOLD, VOLUMEFILLHOLES

% ensure that SPM is available, needed for spm_smooth
hasspm = ft_hastoolbox('spm8up', 3) || ft_hastoolbox('spm2', 1);

if nargin==3
  fprintf('smoothing %s with a %d-voxel FWHM kernel\n', str, fwhm);
end