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: tregion_indices.m
    path of file: ./repos/IRtools/Extra/prblur_tools/@psfMatrix/private
    
    the code of the file until where you have to start completion: function [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize)
%
%    [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize);
%
%  This is needed in variantTransposeMultiply.m

    
function [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize)
%
%    [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize);
%
%  This is needed in variantTransposeMultiply.m
%
%  Input:
%         RIidx   \
%         RJidx     -  indices coming from region_indices.m
%         RKidx   /
%       padsize     -  amount of padding for boundary conditions
%
%  Output:
%        TIidx      -  array with two columns, giving region indices for the
%                      first image dimension.  The first column specifies
%                      the index of the beginning of each region.  The second
%                      column specifies the index of the end