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_custom_ui.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function [inverse] = spm_eeg_inv_custom_ui(D)
% GUI for parameters of inversion of forward model for EEG-MEG
% FORMAT [inverse] = spm_eeg_inv_custom_ui(D)
%
% D  - M/EEG data structure
%
% gets:
%
%     inverse.type   - 'GS' Greedy search on MSPs
%                      'ARD' ARD search on MSPs
%                      'LOR' LORETA-like model
%                      'IID' LORETA and minimum norm
%     inverse.woi    - time window of interest ([start stop] in ms)
%     inverse.Han    - switch for Hanning window
%     inverse.lpf    - band-pass filter - low frequency cut-off (Hz)
%     inverse.hpf    - band-pass filter - high frequency cut-off (Hz)
%     inverse.pQ     - any source priors (eg from fMRI) - cell array
%     inverse.xyz    - (n x 3) locations of spherical VOIs
%     inverse.rad    - radius (mm) of VOIs
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston

    
function [inverse] = spm_eeg_inv_custom_ui(D)
% GUI for parameters of inversion of forward model for EEG-MEG
% FORMAT [inverse] = spm_eeg_inv_custom_ui(D)
%
% D  - M/EEG data structure
%
% gets:
%
%     inverse.type   - 'GS' Greedy search on MSPs
%                      'ARD' ARD search on MSPs
%                      'LOR' LORETA-like model
%                      'IID' LORETA and minimum norm
%     inverse.woi    - time window of interest ([start stop] in ms)
%     inverse.Han    - switch for Hanning window
%     inverse.lpf    - band-pass filter - low frequency cut-off (Hz)
%     inverse.hpf    - band-pass filter - high frequency cut-off (Hz)
%     inverse.pQ     - any source priors (eg from fMRI) - cell array
%     inverse.xyz    - (n x 3) locations of spherical VOIs
%     inverse.rad    - radius (mm) of VOIs
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston
% $Id: spm_eeg_inv_custom_ui.m 6633 2015-12-04 17:09:24Z vladimir $
 
% defaults from D is specified
%==========================================================================
try
    woi = fix([D.time(1) D.time(end