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: reslice_imgs.m
    path of file: ./repos/CanlabCore/CanlabCore/Image_computation_tools
    
    the code of the file until where you have to start completion: function [P, reslicedImgs] = reslice_imgs(sampleTo, resliceThis, varargin)
% arguments are file names of .img files
% if empty, select from GUI% :Usage:

    
function [P, reslicedImgs] = reslice_imgs(sampleTo, resliceThis, varargin)
% arguments are file names of .img files
% if empty, select from GUI% :Usage:
%
% ::
%
%     function [P, reslicedImgs] = reslice_imgs(sampleTo, resliceThis, [domask], [overwrite])
%
% if domask, recalculates a 1 or 0 mask for each image file in resliceThis
% if overwrite, overwrite the original instead of prepend