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: CBIG_ProjectMNI2fsaverage_Ants.m
    path of file: ./repos/CBIG/utilities/matlab/transforms
    
    the code of the file until where you have to start completion: function [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, average, interp_type, lh_index_mat, rh_index_mat)

% Usage: [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, average, interp_type, lh_index_mat, rh_index_mat)
%
% Function projects MNI data to fsaverage
% Also see reverse transform CBIG_Projectfsaverage2MNI_Ants
% 
% ---------------------------------------------------------------------
% EXAMPLE USAGE: Project cortical gyral labels to MNI template and back
% ---------------------------------------------------------------------
% >> lh_avg_mesh = CBIG_ReadNCAvgMesh('lh', 'fsaverage', 'inflated', 'aparc.a2009s.annot');
% >> rh_avg_mesh = CBIG_ReadNCAvgMesh('rh', 'fsaverage', 'inflated', 'aparc.a2009s.annot');
% >> CBIG_DrawSurfaceMaps(lh_avg_mesh.MARS_label, rh_avg_mesh.MARS_label, 'fsaverage', 'inflated', 0, 36);
% >> data = CBIG_Projectfsaverage2MNI_Ants(lh_avg_mesh.MARS_label', rh_avg_mesh.MARS_label');
% >> [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, 'fsaverage', 'nearest'); 
% >> CBIG_DrawSurfaceMaps(lh_proj_data(1, :), rh_proj_data(1, :), 'fsaverage', 'inflated', 0, 36); 
% 
% -----------
% INTPUTS

    
function [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, average, interp_type, lh_index_mat, rh_index_mat)

% Usage: [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, average, interp_type, lh_index_mat, rh_index_mat)
%
% Function projects MNI data to fsaverage
% Also see reverse transform CBIG_Projectfsaverage2MNI_Ants
% 
% ---------------------------------------------------------------------
% EXAMPLE USAGE: Project cortical gyral labels to MNI template and back
% ---------------------------------------------------------------------
% >> lh_avg_mesh = CBIG_ReadNCAvgMesh('lh', 'fsaverage', 'inflated', 'aparc.a2009s.annot');
% >> rh_avg_mesh = CBIG_ReadNCAvgMesh('rh', 'fsaverage', 'inflated', 'aparc.a2009s.annot');
% >> CBIG_DrawSurfaceMaps(lh_avg_mesh.MARS_label, rh_avg_mesh.MARS_label, 'fsaverage', 'inflated', 0, 36);
% >> data = CBIG_Projectfsaverage2MNI_Ants(lh_avg_mesh.MARS_label', rh_avg_mesh.MARS_label');
% >> [lh_proj_data, rh_proj_data] = CBIG_ProjectMNI2fsaverage_Ants(data, 'fsaverage', 'nearest'); 
% >> CBIG_DrawSurfaceMaps(lh_proj_data(1, :), rh_proj_data(1, :), 'fsaverage', 'inflated', 0, 36); 
% 
% -----------
% INTPUTS
% -----------
%    - data        : 
%                    assumed to be read using MRIread in MNI152 space (can be 4 dimensional)
%    - average     : 
%                    'fsaverage', 'fsaverage6' or 'fsaverage5'
%    - interp_type : 
%                    'linear' (default), 'nearest', 'spline', 'cubic'
%    - lh_index_mat: 
%                    .mat file containing matrix "ras": a 3 x num_vertices matrix specifying for each left hemi vertex 
%                    the corresponding MNI152 RAS coordinates. 
%                    (default is $CBIG_CODE_DIR/utilities/matlab/transforms/CorrespondenceFreeSurferVolSurfSpace_Wu2017/final_warps_FS5.3/lh.avgMapping_allSub_RF_ANTs_MNI152_orig_to_fsaverage.mat)
%    - rh_index_mat: 
%                    .mat file containing matrix "ras": a 3 x num_vertices matrix specifying for each right hemi vertex 
%                    the corresponding MNI152 RAS coordinates. 
%                    (default is $CBIG_CODE_DIR/utilities/matlab/transforms/CorrespondenceFreeSurferVolSurfSpace_Wu2017/final_warps_FS5.3/rh.avgMapping_allSub_RF_ANTs_MNI152_orig_to_fsaverage.mat)       
% 
% The default index matrices are 3 x 163842 corresponding to fsaverage
% resolution. Even if you are interested in lower resolution, I suggest you
% project to fsaverage resolution, smooth and downsample.
%
% Due to the way the code works, the data volume just needs to be in MNI152
% space. The data can be 2mm, 3mm and with different headers. That's ok as long as
% their corresponding RAS coordinates are correct. To check, I recommend