function fourdim = conv2dto4d(twodim,nRows,nCols,nLays,nodes)

nPrintTimes = size(twodim,2);
fourdim = repmat(NaN,[nRows,nCols,nLays,nPrintTimes]);
for iPrintTime=1:nPrintTimes
    tmp = repmat(NaN,[nRows,nCols,nLays]);
    tmp(1:nRows*nCols*nLays) = twodim(nodes.ID(:),iPrintTime);
    fourdim(:,:,:,iPrintTime) = tmp;
end
