def splitTZCYXArray(array, lengths, axis):
    """
    Split hyperstack into multiple hyperstacks of identical shape in all axes
    except for the split axis

    @param array: 5D hyperstack to split
    @type array: numpy.ndarray
    @param lengths: list of ordered lengths of of output arrays arrays along
        split axis
    @type lengths: list
    @param axis: axis along which to split:
        0: split first time dimension
        1: split across second depth dimension
        2: split across third channel dimension
    @type axis: int

    @return: list of 5D hyperstacks with identical shapes except for split
        axis. Array[x].shape[axis] = length[x]
    @rtype: list
    """
    lengths = lengths + [0]
    lengths = [sum(lengths[:x]) for x in range(len(lengths))]
    slices = [slice(None)] * array.ndim
    arrays = list()
    for x in range(len(lengths) - 1):
        currentSlice = slices
        currentSlice[axis] = slice(lengths[x], lengths[x + 1])
        arrays = arrays + [array[tuple(currentSlice)]]

    return arrays