def fromtif(path, ext='tif', start=None, stop=None, recursive=False, nplanes=None, npartitions=None, labels=None, engine=None, credentials=None, discard_extra=False):
    """
    Loads images from single or multi-page TIF files.

    Parameters
    ----------
    path : str
        Path to data files or directory, specified as either a local filesystem path
        or in a URI-like format, including scheme. May include a single '*' wildcard character.

    ext : string, optional, default = 'tif'
        Extension required on data files to be loaded.

    start, stop : nonnegative int, optional, default = None
        Indices of the first and last-plus-one file to load, relative to the sorted
        filenames matching 'path' and 'ext'. Interpreted using python slice indexing conventions.

    recursive : boolean, optional, default = False
        If true, will recursively descend directories from path, loading all files
        with an extension matching 'ext'.

    nplanes : positive integer, optional, default = None
        If passed, will cause single files to be subdivided into nplanes separate images.
        Otherwise, each file is taken to represent one image.

    npartitions : int, optional, default = None
        Number of partitions for computational engine,
        if None will use default for engine.

    labels : array, optional, default = None
        Labels for records. If provided, should be one-dimensional.

    discard_extra : boolean, optional, default = False
        If True and nplanes doesn't divide by the number of pages in a multi-page tiff, the reminder will
        be discarded and a warning will be shown. If False, it will raise an error
    """
    from tifffile import TiffFile

    if nplanes is not None and nplanes <= 0:
        raise ValueError('nplanes must be positive if passed, got %d' % nplanes)

    def getarray(idx_buffer_filename):
        idx, buf, fname = idx_buffer_filename
        fbuf = BytesIO(buf)
        tfh = TiffFile(fbuf)
        ary = tfh.asarray()
        pageCount = ary.shape[0]
        if nplanes is not None:
            extra = pageCount % nplanes
            if extra:
                if discard_extra:
                    pageCount = pageCount - extra
                    logging.getLogger('thunder').warn('Ignored %d pages in file %s' % (extra, fname))
                else:
                    raise ValueError("nplanes '%d' does not evenly divide '%d in file %s'" % (nplanes, pageCount,
                                                                                              fname))
            values = [ary[i:(i+nplanes)] for i in range(0, pageCount, nplanes)]
        else:
            values = [ary]
        tfh.close()

        if ary.ndim == 3:
            values = [val.squeeze() for val in values]

        nvals = len(values)
        keys = [(idx*nvals + timepoint,) for timepoint in range(nvals)]
        return zip(keys, values)

    recount = False if nplanes is None else True
    data = frompath(path, accessor=getarray, ext=ext, start=start, stop=stop,
                    recursive=recursive, npartitions=npartitions, recount=recount,
                    labels=labels, engine=engine, credentials=credentials)
    if engine is not None and npartitions is not None and data.npartitions() < npartitions:
        data = data.repartition(npartitions)
    return data
Loads images from single or multi-page TIF files.

    Parameters
    ----------
    path : str
        Path to data files or directory, specified as either a local filesystem path
        or in a URI-like format, including scheme. May include a single '*' wildcard character.

    ext : string, optional, default = 'tif'
        Extension required on data files to be loaded.

    start, stop : nonnegative int, optional, default = None
        Indices of the first and last-plus-one file to load, relative to the sorted
        filenames matching 'path' and 'ext'. Interpreted using python slice indexing conventions.

    recursive : boolean, optional, default = False
        If true, will recursively descend directories from path, loading all files
        with an extension matching 'ext'.

    nplanes : positive integer, optional, default = None
        If passed, will cause single files to be subdivided into nplanes separate images.
        Otherwise, each file is taken to represent one image.

    npartitions : int, optional, default = None
        Number of partitions for computational engine,
        if None will use default for engine.

    labels : array, optional, default = None
        Labels for records. If provided, should be one-dimensional.

    discard_extra : boolean, optional, default = False
        If True and nplanes doesn't divide by the number of pages in a multi-page tiff, the reminder will
        be discarded and a warning will be shown. If False, it will raise an error