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: tiffread31_header.m
    path of file: ./repos/TIFFStack/private
    
    the code of the file until where you have to start completion: function [TIF, HEADER, INFO] = tiffread31_header(file_name)

DEF_nPreallocateBlock = 1000;
DEF_HEADER = struct( 'SamplesPerPixel', [], 'index', [], 'ifd_pos', [], ...
                     'width', [], 'height', [], '
    
function consolidate_strips(BytesPerPlane)

      for (nFrame = 1:numel(HEADER))

         % - Try to consolidate the strips into a single one to speed-up reading
         nBytes = HEADER(nFrame).StripByteCounts(1);

         if (nBytes < BytesPerPlane)

            idx = 1;
            % - Accumulate continguous strips that contribute to the plane
            while (HEADER(nFrame).StripOffsets(1) + nBytes == HEADER(nFrame).StripOffsets(idx+1))
               idx = idx + 1;
               nBytes = nBytes + HEADER(nFrame).StripByteCounts(idx);
               if ( nBytes >= BytesPerPlane ); break; end