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: mne_read_source_spaces.m
    path of file: ./repos/spm/external/mne
    
    the code of the file until where you have to start completion: function [src] = mne_read_source_spaces(source,add_geom,tree)
%
% [src] = mne_read_source_spaces(source,add_geom,tree)
%
% Reads source spaces from a fif file
%
% source      - The name of the file or an open file id
% add_geom    - Add geometry information to the source spaces
% tree        - Required if source is an open file id, search for the
%               source spaces here
%

%
%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%   Revision 1.13  2007/03/11 13:32:22  msh
%   Nearest numbers had to be incremented by one to comply with the 1-based Matlab indexing
%
%   Revision 1.12  2006/09/25 19:48:16  msh
%   Added projection item kinds to fiff_define_constants
%   Changed some fields to int32 in surface structures
%
%   Revision 1.11  2006/05/22 10:44:44  msh
%   Added surface and curvature reading routines.
%   Fixed error in mne_read_source_spaces: triangle normals were not normalized
%
%   Revision 1.10  2006/05/05 03:50:40  msh
%   Added routines to compute L2-norm inverse solutions.
%   Added mne_write_inverse_sol_stc to write them in stc files
%   Several bug fixes in other files

    
function [src] = mne_read_source_spaces(source,add_geom,tree)
%
% [src] = mne_read_source_spaces(source,add_geom,tree)
%
% Reads source spaces from a fif file
%
% source      - The name of the file or an open file id
% add_geom    - Add geometry information to the source spaces
% tree        - Required if source is an open file id, search for the
%               source spaces here
%

%
%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%   Revision 1.13  2007/03/11 13:32:22  msh
%   Nearest numbers had to be incremented by one to comply with the 1-based Matlab indexing
%
%   Revision 1.12  2006/09/25 19:48:16  msh
%   Added projection item kinds to fiff_define_constants
%   Changed some fields to int32 in surface structures
%
%   Revision 1.11  2006/05/22 10:44:44  msh
%   Added surface and curvature reading routines.
%   Fixed error in mne_read_source_spaces: triangle normals were not normalized
%
%   Revision 1.10  2006/05/05 03:50:40  msh
%   Added routines to compute L2-norm inverse solutions.
%   Added mne_write_inverse_sol_stc to write them in stc files
%   Several bug fixes in other files
%
%   Revision 1.9  2006/05/03 19:05:06  msh
%   Eliminated more Matlab 6.5 incompatibility
%
%   Revision 1.8  2006/05/03 18:53:06  msh
%   Approaching Matlab 6.5 backward compatibility
%
%   Revision 1.7  2006/05/03 15:50:39  msh
%   Fixed some Matlab 6.5 incompatibility.
%
%   Revision 1.6  2006/04/28 18:01:27  msh
%   Added mne_read_bem_surfaces
%   Fixed errors in mne_read_source_spaces and improved triangle data computation.
%
%   Revision 1.5  2006/04/23 15:29:41  msh
%   Added MGH to the copyright
%
%   Revision 1.4  2006/04/20 21:49:38  msh
%   Added mne_read_inverse_operator
%   Changed some of the routines accordingly for more flexibility.
%
%   Revision 1.3  2006/04/18 23:21:22  msh
%   Added mne_transform_source_space_to and mne_transpose_named_matrix
%
%   Revision 1.2  2006/04/18 20:44:46  msh
%   Added reading of forward solution.
%   Use length instead of size when appropriate
%
%   Revision 1.1  2006/04/17 21:05:08  msh
%   Added source space reading routine.
%
%

me='MNE:mne_read_source_spaces';

global FIFF;
if isempty(FIFF)
    FIFF = fiff_define_constants();
end