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: OSL_weightedmean.m
    path of file: ./repos/OMEGA/source
    
    the code of the file until where you have to start completion: function x_weighted = OSL_weightedmean(options)
%OSL_FMH One Step Late algorithm with weigthed mean prior reconstruction.
%   Implements the OSL weigthed mean prior prior reconstruction on input 
%   PET data. See main_nongate.m for options-variables.
%
%   x_weighted = OSL_weightedmean(options) returns the OSL weigthed mean prior
%   reconstructions for all iterations, including the initial value.

    
function x_weighted = OSL_weightedmean(options)
%OSL_FMH One Step Late algorithm with weigthed mean prior reconstruction.
%   Implements the OSL weigthed mean prior prior reconstruction on input 
%   PET data. See main_nongate.m for options-variables.
%
%   x_weighted = OSL_weightedmean(options) returns the OSL weigthed mean prior
%   reconstructions for all iterations, including the initial value.

if iscell(options.SinM)
    Sino = options.SinM{1};
    Sino = Sino(:);
else
    Sino = options.SinM;
    Sino = Sino(:);
end