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: extractKSpace4D.m
    path of file: ./repos/CS_MoCo_LAB/reconstruction/matlab/CS_LAB_matlab/preproc
    
    the code of the file until where you have to start completion: function [kSpace, evalMask] = extractKSpace4D(dData, iLC, iEvalInfoMask, dim, inLoops, phaseLCcol)
% extract kSpace from acquired 4D data
%
% (c) Thomas Kuestner

    
function [kSpace, evalMask] = extractKSpace4D(dData, iLC, iEvalInfoMask, dim, inLoops, phaseLCcol)
% extract kSpace from acquired 4D data
%
% (c) Thomas Kuestner
% ---------------------------------------------------------------------

% Check the input data
% These loop counters have to be constant in one slice
% iSingularLCs = iLC(:,[1, 2, 5, 7, 9, 10, 11]); % Sam, Cha, Sli, Eco, Rep, Set, Seg
% if any(min(iSingularLCs) ~= max(iSingularLCs))
%     error('CS_reconstruction()::extractKSpace3D()','Input data contains data from multiple sample sizes/channel counts/slices/echos/repetitions/sets/segments!');
% end