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: OF_options.m
    path of file: ./repos/flow_registration/core
    
    the code of the file until where you have to start completion: % OF_OPTIONS class to store options for a motion compensation 
% job. 

% Author   : Philipp Flotho
% Copyright 2021 by Philipp Flotho, All rights reserved.
classdef OF_options < handle & matlab.mixin.Copyable
    
    properties (Access = private)
        p;
        supported_extensions = {'.MDF', '.tif', '.tiff', ...
            '.mat'};
        ext_map = {'MDF', 'TIFSTACK', 'TIFSTACK', 'MAT'};
        quality_setting_old = 'quality';
    end
    
    properties (SetAccess = private, GetAccess = public)
        datatype = 'NONE';
        preproc_funct = []; % @(x) x;
    end
    
    properties
        input_file;
        output_path = 'results';
        output_format = 'MAT';
        channel_idx = [];
        output_file_name = [];
        output_file_writer = [];
        alpha = 1.5;
        weight = [0.5, 0.5];
        levels = 100;
        min_level = -1; % Min level overrides the quality setting!
        quality_setting = 'quality';
        eta = 0.8;
        update_lag = 5;
        iterations = 50;
        a_smooth = 1;
        a_data = 0.45;
        sigma = [1, 1, 0.1; ...
                 1, 1, 0.1];
        bin_size = 1;
        buffer_size = 400;
        verbose = false;
        reference_frames = 50:500;
        save_meta_info = true;
        save_w = false;
        save_valid_mask = false;
        output_typename = 'double';
        channel_normalization = 'joint';
        interpolation_method = 'cubic';
        cc_initialization = false;
        update_reference = false;
        update_initialization_w = true;
        n_references = 1;
        min_frames_per_reference = 20;
        naming_convention = 'default';
        save_valid_idx = false;
    end
    
    methods
        function obj = OF_options(varargin)
            p = inputParser;

            addParameter(p, 'output_path', 'results', @(x) obj.isStringOrChar(x));
            addParameter(p, 'output_format', obj.output_format);
            addParameter(p, 'input_file', []);            
            addParameter(p, 'weight', obj.weight, @isnumeric);
            addParameter(p, 'alpha', obj.alpha);
            addParameter(p, 'levels', obj.levels, @(x) isnumeric(x) && isscalar(x));
            addParameter(p, 'min_level', -1, @(x) isnumeric(x) && isscalar(x) && x >= 0); 
            addParameter(p, 'eta', obj.eta, @isnumeric);
            addParameter(p, 'update_lag', obj.update_lag, @isnumeric);
            addParameter(p, 'iterations', obj.iterations, @isnumeric);
            addParameter(p, 'reference_frames', obj.reference_frames);
            addParameter(p, 'a_smooth', obj.a_smooth, @isnumeric);
            addParameter(p, 'a_data', obj.a_data
    
function obj = OF_options(varargin)
            p = inputParser;

            addParameter(p, 'output_path', 'results', @(x) obj.isStringOrChar(x));
            addParameter(p, 'output_format', obj.output_format);
            addParameter(p, 'input_file', []);            
            addParameter(p, 'weight', obj.weight, @isnumeric);
            addParameter(p, 'alpha', obj.alpha);
            addParameter(p, 'levels', obj.levels, @(x) isnumeric(x) && isscalar(x));
            addParameter(p, 'min_level', -1, @(x) isnumeric(x) && isscalar(x) && x >= 0); 
            addParameter(p, 'eta', obj.eta, @isnumeric);
            addParameter(p, 'update_lag', obj.update_lag, @isnumeric);
            addParameter(p, 'iterations', obj.iterations, @isnumeric);
            addParameter(p, 'reference_frames', obj.reference_frames);
            addParameter(p, 'a_smooth', obj.a_smooth, @isnumeric);
            addParameter(p, 'a_data', obj.a_data, @isnumeric);
            addParameter(p, 'sigma', obj.sigma, @isnumeric);
            addParameter(p, 'bin_size', obj.bin_size, @isnumeric);
            addParameter(p, 'buffer_size', obj.buffer_size, @isnumeric);
            addParameter(p, 'verbose', obj.verbose, @islogical);
            addParameter(p, 'save_meta_info', obj.save_meta_info, @islogical);
            addParameter(p, 'preproc_funct', obj.preproc_funct, ...
                @(x) isa(x, 'function_handle'))
            addParameter(p, 'output_typename', obj.output_typename, ...
                @(x) isempty(x) || exist(x, 'class'));
            addParameter(p, 'save_w', obj.save_w, ...
                @(x) isscalar(x) && islogical(x));
            addParameter(p, 'channel_normalization', obj.channel_normalization, ...
                @(x) obj.isStringOrChar(x) && any(strcmp(x, {'joint', 'separate'})))
            addParameter(p, 'quality_setting', obj.quality_setting, ...
                @(x) obj.isStringOrChar(x) &&  any(strcmp(x, ...
                {'quality', 'balanced', 'fast'})));
            addParameter(p, 'interpolation_method', obj.interpolation_method, ...
                @(x) obj.isStringOrChar(x) && any(strcmp(x, {'nearest', 'linear', 'cubic'})))
            addParameter(p, 'update_reference', obj.update_reference, ...
                @(x) islogical(x));
            addParameter(p, 'update_initialization_w', obj.update_initialization_w, ...
                @(x) islogical(x));
            addParameter(p, 'n_references', obj.n_references, ...
                @(x) isscalar(x) && x >= 1)
            addParameter(p, 'min_frames_per_reference', obj.min_frames_per_reference, ...
                @(x) isscalar(x) && x >= 1)
            addParameter(p, 'cc_initialization', obj.cc_initialization);
            addParameter(p, 'save_valid_mask', obj.save_valid_mask, ...
                @(x) isscalar(x) && islogical(x));
            addParameter(p, 'naming_convention', obj.naming_convention, ...
                @(x) obj.isStringOrChar(x) &&  any(strcmp(x, ...
                {'default', 'batch'})));
            addParameter(p, 'save_valid_idx', obj.save_valid_idx, ...
                @(x) isscalar(x) && islogical(x));
            parse(p, varargin{:});

            for i = 1:length(p.Parameters)
               obj.(p.Parameters{i}) = p.Results.(p.Parameters{i});
            end