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: filemenu.m
    path of file: ./repos/segment-open/source
    
    the code of the file until where you have to start completion: function varargout = filemenu(varargin)
% FILEMENU
% File menu callbacks

% Nisse Lundahl

%Invoke subfunction
macro_helper(varargin{:}); %future macro recording use
if (nargout)
  [varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
  feval(varargin{:
    
function savesegmentation_Callback(pathname,filename)
%----------------------------------------------------
%Saves segmentation as a .seg file. This way of saving contours is not
%recommended and may be depreceiated.
global DATA SET NO

segment('stopmovie_Callback');

%---Find what directory
if nargin==0
  pathname = DATA.Preview.PathName;
  %pathname = DATA.Pref.exportpath;
  [filename,pathname] = myuiputfile([pathname filesep '*.seg'],dprintf('Save segmentation as'));
  if isequal(filename,0)||isequal(pathname,0)
    mydisp('Save segmentation aborted by user');
    return;
  end