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: BioFormatsReader.m
    path of file: ./repos/u-shape3D/software/@BioFormatsReader
    
    the code of the file until where you have to start completion: classdef  BioFormatsReader < Reader
    % BioFormatsReader is a Reader subclass which reads metadata/pixels
    % from image files using the Bio-Formats library
    %
    % See also Reader
%
% 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 F
    
function obj = BioFormatsReader(varargin)
            
            % Input check
            ip = inputParser();
            ip.addRequired('id', @ischar);
            ip.addOptional('series', 0, @(x) validateattributes(x, {'numeric'}, {'scalar'}));
            ip.addParamValue('reader', [], @(x) isa(x, 'loci.formats.IFormatReader'));
            % Directory for memo file
            ip.addParamValue('directory',bfGetMemoDirectory(), @ischar);
            ip.parse(varargin{:});
            
            % Initialize Bio-Formats and log4j
            bfInitLogging();
            
            obj.id = ip.Results.id;
            if ~isempty(ip.Results.reader),
                obj.formatReader = ip.Results.reader;
            else
                obj.formatReader = bfGetMemoizer([], ip.Results.directory);
                try
                    obj.formatReader.setId(obj.id);
                catch
                    % The following block is a workaround for handling
                    % FileNotFoundException when a file is relocated
                    % together with its memo file.
                    % Hopefully this should be fixed at the Bio-Formats
                    % level directly in a 5.1.x releas
                    delete(obj.formatReader.getMemoFile(obj.id));
                    obj.formatReader.close();
                    obj.formatReader.setId(obj.id);
                end