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_get_vol_sens.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function data = spm_eeg_inv_get_vol_sens(D, val, space, gradsource, modality)

    
function data = spm_eeg_inv_get_vol_sens(D, val, space, gradsource, modality)
% Retrieves data for leadfield computation from D.inv structure
% FORMAT data = spm_eeg_inv_get_vol_sens(D, val, space, gradsource, modality)
%    D   -  @meeg object
%    val - inversion index (overrides D.val)
%    space - one of 'MNI-aligned', 'Head', 'Native' (default 'MNI-aligned')
%    gradsource - 'inv' (default) to get MEG grad from D.inv
%                 otherwise from D.sensors (useful for reusing head-models
%                 for different runs in the same session)
%    modality - 'EEG' or 'MEG' to force only one modality for multimodal
%                datasets
%__________________________________________________________________________

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

data   = [];

D      = spm_eeg_load(D);

if isempty(D)
    return;
end