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: tsss_spm_momentspace.m
    path of file: ./repos/spm/toolbox/TSSS
    
    the code of the file until where you have to start completion: function D = tsss_spm_momentspace(S)
% Switch a dataset to SSS space using virtual montage
% FORMAT D = spm_eeg_crop(S)
%
% S        - input struct
%  fields of S:
%   D          - MEEG object or filename of M/EEG mat-file with data after
%                TSSS tool
%   condthresh - threshold on condition number for regularisation

    
function D = tsss_spm_momentspace(S)
% Switch a dataset to SSS space using virtual montage
% FORMAT D = spm_eeg_crop(S)
%
% S        - input struct
%  fields of S:
%   D          - MEEG object or filename of M/EEG mat-file with data after
%                TSSS tool
%   condthresh - threshold on condition number for regularisation
%
% Output:
% D        - MEEG object (also written on disk)
%
% Reference: Vrba J, Taulu S, Nenonen J, Ahonen A. Signal space separation
% beamformer. Brain Topogr. 2010 Jun;23(2):128-33.
%__________________________________________________________________________

% Vladimir Litvak
% Copyright (C) 2014-2022 Wellcome Centre for Human Neuroimaging


%-Startup
%--------------------------------------------------------------------------
spm('FnBanner', mfilename);
spm('FigName','TSSS momenspace transformation'); spm('Pointer','Watch');

if ~isfield(S, 'condthresh'),       S.condthresh   = 80;           end