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: form_sinograms.m
    path of file: ./repos/OMEGA/source
    
    the code of the file until where you have to start completion: function [varargout] = form_sinograms(options, varargin)
%% FORM MICHELOGRAMS AND SINOGRAMS FROM RAW DETECTOR PAIR DATA
% This code forms the sinograms for the current machine from the raw
% list-mode data using the raw detector pairs. It first creates the
% Michelogram and later the sinograms with the dimensions specified by the
% user.
%
% Can also be used to simply perform the selected corrections to the
% specified uncorrected sinogram.
%
% Input the machine and sinogram properties and the raw detector pair
% data.
% Output is the sinograms for each time point, saved in a mat-file in the
% current working directory. Any previous corrections are overwritten.
%
% Randoms, scatter and normalization corrections are applied if applicable.
%
% OUTPUT:
%   raw_SinM = The raw sinogram without any corrections or, if Inveon data
%   is used, the Inveon sinogram file. In the former case this is the first
%   output ONLY if no corrections are applied OR if corrections are applied
%   during reconstruction

    
function [varargout] = form_sinograms(options, varargin)
%% FORM MICHELOGRAMS AND SINOGRAMS FROM RAW DETECTOR PAIR DATA
% This code forms the sinograms for the current machine from the raw
% list-mode data using the raw detector pairs. It first creates the
% Michelogram and later the sinograms with the dimensions specified by the
% user.
%
% Can also be used to simply perform the selected corrections to the
% specified uncorrected sinogram.
%
% Input the machine and sinogram properties and the raw detector pair
% data.
% Output is the sinograms for each time point, saved in a mat-file in the
% current working directory. Any previous corrections are overwritten.
%
% Randoms, scatter and normalization corrections are applied if applicable.
%
% OUTPUT:
%   raw_SinM = The raw sinogram without any corrections or, if Inveon data
%   is used, the Inveon sinogram file. In the former case this is the first
%   output ONLY if no corrections are applied OR if corrections are applied
%   during reconstruction
%   SinM = Sinogram with all the selected corrections applied. First input
%   if any corrections are applied and corrections are NOT performed during
%   image reconstruction, otherwise the second input
%   SinDelayed = Delayed coincidence sinogram (with optional variance
%   reduction and/or smoothing)
%   raw_SinDelayed = Delayed coincidence sinogram (no modifications)
%   SinTrues = True coincidences (GATE only)
%   SinScatter = Scattered coincidence sinogram (GATE only)
%   SinRandoms = Randoms coincidence sinogram (GATE only)
%
% See also michelogram_formation, load_data, sinogram_coordinates_2D,
% sinogram_coordinates_3D, gapFilling, arcCorrection



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2020 Ville-Veikko Wettenhovi, Samuli Summala
%
% 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 3 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, see <https://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if nargout > 5
    error('Too many output arguments')
end