class_docstr: Support for tifffile as backend.
  
  Parameters
  ----------
  request : iio.Request
      A request object that represents the users intent. It provides a
      standard interface for a plugin to access the various ImageResources.
      Check the docs for details.
  kwargs : Any
      Additional kwargs are forwarded to tifffile's constructor, i.e.
      to ``TiffFile`` for reading or ``TiffWriter`` for writing.
class_docstr_tok: ["Support","for","tifffile","as","backend",".","Parameters","--","--","--","--","--","request",":","iio.Request","A","request","object","that","represents","the","users","intent",".","It","provides","a","standard","interface","for","a","plugin","to","access","the","various","ImageResources",".","Check","the","docs","for","details",".","kwargs",":","Any","Additional","kwargs","are","forwarded","to","tifffile","'s","constructor",",","i.e",".","to","``","TiffFile","``","for","reading","or","``","TiffWriter","``","for","writing","."]
docstr: Read a ndimage or page.
  
  The ndimage returned depends on the value of both ``index`` and
  ``page``. ``index`` selects the series to read and ``page`` allows
  selecting a single page from the selected series. If ``index=None``,
  ``page`` is understood as a flat index, i.e., the selection ignores
  individual series inside the file. If both ``index`` and ``page`` are
  ``None``, then all the series are read and returned as a batch.
  
  Parameters
  ----------
  index : int
      If ``int``, select the ndimage (series) located at that index inside
      the file and return ``page`` from it. If ``None`` and ``page`` is
      ``int`` read the page located at that (flat) index inside the file.
      If ``None`` and ``page=None``, read all ndimages from the file and
      return them as a batch.
  page : int
      If ``None`` return the full selected ndimage. If ``int``, read the
      page at the selected index and return it.
  kwargs : Any
      Additional kwargs are forwarded to TiffFile's ``as_array`` method.
  
  Returns
  -------
  ndarray : np.ndarray
      The decoded ndimage or page.
docstr_tok: ["Read","a","ndimage","or","page",".","The","ndimage","returned","depends","on","the","value","of","both","``","index","``","and","``","page","``",".","``","index","``","selects","the","series","to","read","and","``","page","``","allows","selecting","a","single","page","from","the","selected","series",".","If","``","index=None","``",",","``","page","``","is","understood","as","a","flat","index",",","i.e.",",","the","selection","ignores","individual","series","inside","the","file",".","If","both","``","index","``","and","``","page","``","are","``","None","``",",","then","all","the","series","are","read","and","returned","as","a","batch",".","Parameters","--","--","--","--","--","index",":","int","If","``","int","``",",","select","the","ndimage","(","series",")","located","at","that","index","inside","the","file","and","return","``","page","``","from","it",".","If","``","None","``","and","``","page","``","is","``","int","``","read","the","page","located","at","that","(","flat",")","index","inside","the","file",".","If","``","None","``","and","``","page=None","``",",","read","all","ndimages","from","the","file","and","return","them","as","a","batch",".","page",":","int","If","``","None","``","return","the","full","selected","ndimage",".","If","``","int","``",",","read","the","page","at","the","selected","index","and","return","it",".","kwargs",":","Any","Additional","kwargs","are","forwarded","to","TiffFile","'s","``","as_array","``","method",".","Returns","--","--","--","-","ndarray",":","np.ndarray","The","decoded","ndimage","or","page","."]
code: def read(
      self, *, index: int = None, page: int = None, **kwargs
  ) -> np.ndarray:
      """Read a ndimage or page.
  
      The ndimage returned depends on the value of both ``index`` and
      ``page``. ``index`` selects the series to read and ``page`` allows
      selecting a single page from the selected series. If ``index=None``,
      ``page`` is understood as a flat index, i.e., the selection ignores
      individual series inside the file. If both ``index`` and ``page`` are
      ``None``, then all the series are read and returned as a batch.
  
      Parameters
      ----------
      index : int
          If ``int``, select the ndimage (series) located at that index inside
          the file and return ``page`` from it. If ``None`` and ``page`` is
          ``int`` read the page located at that (flat) index inside the file.
          If ``None`` and ``page=None``, read all ndimages from the file and
          return them as a batch.
      page : int
          If ``None`` return the full selected ndimage. If ``int``, read the
          page at the selected index and return it.
      kwargs : Any
          Additional kwargs are forwarded to TiffFile's ``as_array`` method.
  
      Returns
      -------
      ndarray : np.ndarray
          The decoded ndimage or page.
      """
  
      if "key" not in kwargs:
          kwargs["key"] = page
      elif page is not None:
          raise ValueError(
              "Can't use `page` and `key` at the same time."
          )
  
      # set plugin default for ``index``
      if index is not None and "series" in kwargs:
          raise ValueError(
              "Can't use `series` and `index` at the same time."
          )
      elif "series" in kwargs:
          index = kwargs.pop("series")
      elif index is not None:
          pass
      else:
          index = 0
  
      if index is Ellipsis and page is None:
          # read all series in the file and return them as a batch
          ndimage = np.stack([x for x in self.iter(**kwargs)])
      else:
          index = None if index is Ellipsis else index
          ndimage = self._fh.asarray(series=index, **kwargs)
  
      return ndimage
  
file_path: imageio/imageio/plugins/tifffile_v3.py
imports: from io import BytesIO
  from typing import Any, Dict, Optional, cast
  import warnings
  import numpy
  import tifffile
  from ..core.request import URI_BYTES, InitializationError, Request
  from ..core.v3_plugin_api import ImageProperties, PluginV3
  from ..typing import ArrayLike
label_desc: Use image node_id 2 for calling the TifffilePlugin obj's underlying member method code with example usage: obj.read() and returns: ndimage