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: writeFileAnnotation.m
    path of file: ./repos/u-shape3D/software/extern
    
    the code of the file until where you have to start completion: function fa = writeFileAnnotation(session, filePath, varargin)
% WRITEFILEANNOTATION Upload a file and create a file annotation onto OMERO
%
%    fa = writeFileAnnotation(session, filePath) uploads the file specified
%    by filePath and creates a file annotation owned by the session user.
%
%    fa = writeFileAnnotation(session, filePath, 'mimetype', mimetype) also
%    specifies the mimetype of the file.
%
%    fa = writeFileAnnotation(session, filePath, 'namespace', namespace)
%    also sets the namespace of the file annotation.
%
%    fa = writeFileAnnotation(session, filePath, 'description',
%    description) also sets the description of the file annotation.
%
%    fa = writeFileAnnotation(session, filePath, 'group', groupid)
%    sets the group.
%
%    Examples:
%
%        fa = writeFileAnnotation(session, filePath)
%        fa = writeFileAnnotation(session, filePath, 'mimetype', mimetype)
%        fa = writeFileAnnotation(session, filePath, 'description',
%        description)
%
% See also: WRITECOMMENTANNOTATION, WRITEDOUBLEANNOTATION,
% WRITELONGANNOTATION, WRITETAGANNOTATION, WRITETEXTANNOTATION,
% WRITETIMESTAMPANNOTATION, WRITEXMLANNOTATION, UPDATEORIGINALFILE
%
% Copyright (C) 2024, Danuser Lab - UTSouthwestern 
%
% This file is part of Morphology3DPackage.
% 
% Morphology3DPackage is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% 
% Morphology3DPackage is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with Morphology3DPackage.  If not, see <http://www.gnu.org/licenses/>.
% 
% 

% Copyright (C) 2013-2015 University of Dundee & Open Microscopy Environment.
% All rights reserved.
%
% This program is free software; you can redistribute it and/or modify

    
function fa = writeFileAnnotation(session, filePath, varargin)
% WRITEFILEANNOTATION Upload a file and create a file annotation onto OMERO
%
%    fa = writeFileAnnotation(session, filePath) uploads the file specified
%    by filePath and creates a file annotation owned by the session user.
%
%    fa = writeFileAnnotation(session, filePath, 'mimetype', mimetype) also
%    specifies the mimetype of the file.
%
%    fa = writeFileAnnotation(session, filePath, 'namespace', namespace)
%    also sets the namespace of the file annotation.
%
%    fa = writeFileAnnotation(session, filePath, 'description',
%    description) also sets the description of the file annotation.
%
%    fa = writeFileAnnotation(session, filePath, 'group', groupid)
%    sets the group.
%
%    Examples:
%
%        fa = writeFileAnnotation(session, filePath)
%        fa = writeFileAnnotation(session, filePath, 'mimetype', mimetype)
%        fa = writeFileAnnotation(session, filePath, 'description',
%        description)
%
% See also: WRITECOMMENTANNOTATION, WRITEDOUBLEANNOTATION,
% WRITELONGANNOTATION, WRITETAGANNOTATION, WRITETEXTANNOTATION,
% WRITETIMESTAMPANNOTATION, WRITEXMLANNOTATION, UPDATEORIGINALFILE
%
% Copyright (C) 2024, Danuser Lab - UTSouthwestern 
%
% This file is part of Morphology3DPackage.
% 
% Morphology3DPackage is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% 
% Morphology3DPackage is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with Morphology3DPackage.  If not, see <http://www.gnu.org/licenses/>.
% 
% 

% Copyright (C) 2013-2015 University of Dundee & Open Microscopy Environment.
% All rights reserved.
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License along
% with this program; if not, write to the Free Software Foundation, Inc.,
% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

% Input check
ip = inputParser;
ip.addRequired('session');
ip.addRequired('filePath', @(x) exist(x, 'file') == 2);
ip.addParamValue('mimetype', '', @ischar);
ip.addParamValue('namespace', '', @ischar);
ip.addParamValue('description', '', @ischar);
ip.addParamValue('group', [], @(x) isscalar(x) && isnumeric(x));
ip.parse(session, filePath, varargin{:});

% Create original file
originalFile = omero.model.OriginalFileI;
originalFile.setHasher(omero.model.ChecksumAlgorithmI());
originalFile.getHasher.setValue(rstring('SHA1-160'));

if ~isempty(ip.Results.mimetype),
    originalFile.setMimetype(rstring(ip.Results.mimetype));
end