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: replace_empty.m
    path of file: ./repos/CanlabCore/CanlabCore/@image_vector
    
    the code of the file until where you have to start completion: function obj = replace_empty(obj, varargin)
% Replace empty/missing values in an image data object
%
% :Usage:

    
function obj = replace_empty(obj, varargin)
% Replace empty/missing values in an image data object
%
% :Usage:
% ::
%
%    obj = replace_empty(obj, [optional keywords])
%
% Replace missing values in obj.dat stored in obj.removed_voxels and
% obj.removed_images with zeros.  This returns obj.dat in a format that can
% be reconstructed into a 3-D or 4-D image matrix for brain visualization.
%
% :Optional keywords:
%
%   **'voxels' or 'images':**
%        replace only missing voxels/images
%
% ..
%    Tor Wager, 12/1/10
% ..
%
% :See also: remove_empty, zeroinsert, nanremove, naninsert

dovoxels = 1;
doimages = 1;

for i = 1:length(varargin)
    if ischar(varargin{i})
        switch varargin{i}
            
            case 'voxels', doimages = 0;
            case 'images', dovoxels = 0;
                
            otherwise, warning(['Unknown input string option:' varargin{i}]);
        end