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: compare_space.m
    path of file: ./repos/CanlabCore/CanlabCore/@image_vector
    
    the code of the file until where you have to start completion: function isdiff = compare_space(obj, obj2)
% Compare spaces of two image_vector objects
%
% :Usage:
% ::
%

    
function isdiff = compare_space(obj, obj2)
% Compare spaces of two image_vector objects
%
% :Usage:
% ::
%
%     function isdiff = compare_space(obj, obj2)
%
% Returns 0 if same, 1 if different spaces, 2 if no volInfo info for one or
% more objects. 3 if same space, but different in-mask voxels in .dat or
% volInfo.image_indx

if isempty(obj.volInfo) || isempty(obj2.volInfo)
    isdiff = 2;
    return;
end