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: check_properties.m
    path of file: ./repos/CanlabCore/CanlabCore/@atlas
    
    the code of the file until where you have to start completion: function [obj, has_pmaps, has_index, missing_regions] = check_properties(obj, varargin)
% Check properties and enforce some variable types
%
% obj = check_properties(obj)
%

    
function [obj, has_pmaps, has_index, missing_regions] = check_properties(obj, varargin)
% Check properties and enforce some variable types
%
% obj = check_properties(obj)
%
% Optional arguments:
% 'compress_index' : if index numbers are not consecutive integers, some functions,
%                    like select_atlas_subset and num_regions, will not work
%                    This rebuilds the index.  This could happen after resampling or masking.
%                    If you have probability maps entered, probability_maps_to_region_index will do
%                    this. But if not, you may want to do this.

% Defaults

compress_index = false;

% Optional inputs

if any(strcmp(varargin, 'compress_index')), compress_index = true; end