def file_linear_byte_offset(image_size, bytes_per_voxel, start_coords):
    """
    Return the file byte offset corresponding to the given coordinates.
    Files generally assumed to have the first dimension most rapidly changing

    Assumes you have a stream of bytes representing a multi-dimensional image,
    """
    offset = 0
    offset_multiple = bytes_per_voxel
    for coord, image_length in zip(start_coords, image_size):
        offset += coord * offset_multiple
        offset_multiple *= image_length
    return offset
