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: spm_eeg_inv_extract_ui.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function [D] = spm_eeg_inv_extract_ui(varargin)

    
function [D] = spm_eeg_inv_extract_ui(varargin)
% GUI for contrast of evoked responses and power for an MEG-EEG model
% FORMAT [D] = spm_eeg_inv_extract_ui(D, val, XYZ)
% Sets:
%
%     D.contrast.woi   - time (ms) window of interest
%     D.contrast.fboi  - freq (Hz) window of interest
%__________________________________________________________________________
% Copyright (C) 2011 Wellcome Trust Centre for Neuroimaging

% Vladimir Litvak
% $Id: spm_eeg_inv_extract_ui.m 5640 2013-09-18 12:02:29Z vladimir $

% initialise
%--------------------------------------------------------------------------
[D,val] = spm_eeg_inv_check(varargin{1:2});

D.inv{val}.source = [];

if nargin<3
    warndlg('Position in MNI coordinates should be provided');
    return
elseif ~isequal(size(varargin{3}), [1, 3])
    warndlg('A single point in MNI coordinates should be provided');
    return
end