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: tess_interp_mri.m
    path of file: ./repos/brainstorm3/toolbox/anatomy
    
    the code of the file until where you have to start completion: function tess2mri_interp = tess_interp_mri(SurfaceFile, MRI)
% TESS_INTERP_MRI: Interpolate a surface or a grid of points into a MRI.
%
% USAGE:  tess2mri_interp = tess_interp_mri(SurfaceFile, MRI)
%
% INPUT: 
%     - SurfaceFile : Full path to a Brainstorm surface file
%     - MRI         : Brainstorm MRI structure
% OUTPUT:
%     - tess2mri_interp : Huge sparse matrix [nbVoxels, nbVertices]

% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
% 
% Copyright (c) University of Southern California & McGill University
% This software is distributed under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPLv3
% license can be found at http://www.gnu.org/copyleft/gpl.html.
% 
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
% WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
% LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.

    
function tess2mri_interp = tess_interp_mri(SurfaceFile, MRI)
% TESS_INTERP_MRI: Interpolate a surface or a grid of points into a MRI.
%
% USAGE:  tess2mri_interp = tess_interp_mri(SurfaceFile, MRI)
%
% INPUT: 
%     - SurfaceFile : Full path to a Brainstorm surface file
%     - MRI         : Brainstorm MRI structure
% OUTPUT:
%     - tess2mri_interp : Huge sparse matrix [nbVoxels, nbVertices]

% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
% 
% Copyright (c) University of Southern California & McGill University
% This software is distributed under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPLv3
% license can be found at http://www.gnu.org/copyleft/gpl.html.
% 
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
% WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
% LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.
%
% For more information type "brainstorm license" at command prompt.
% =============================================================================@
%
% Authors: Sylvain Baillet, 2002
%          Francois Tadel, 2006 (University of Geneva)
%          Francois Tadel, 2008-2011 (USC)


% ===== CHECK MRI =====
% Check that MRI SCS is well defined
if ~isfield(MRI,'SCS') || ~isfield(MRI.SCS,'R') || ~isfield(MRI.SCS,'T') || isempty(MRI.SCS.R) || isempty(MRI.SCS.T)
    error(['MRI SCS (Subject Coordinate System) was not defined or subjectimage file is from another version of Brainstorm.' 10 10,...
           'Please define the SCS fiducials on this MRI.']);
end