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: Format-Specific TIFF metadata.
  
  The metadata returned depends on the value of both ``index`` and
  ``page``. ``index`` selects a series and ``page`` allows selecting a
  single page from the selected series. If ``index=Ellipsis``, ``page`` is
  understood as a flat index, i.e., the selection ignores individual
  series inside the file. If ``index=Ellipsis`` and ``page=None`` then
  global (file-level) metadata is returned.
  
  Parameters
  ----------
  index : int
      Select the series of which to extract metadata from. If Ellipsis, treat
      page as a flat index into the file's pages.
  page : int
      If not None, select the page of which to extract metadata from. If
      None, read series-level metadata or, if ``index=...`` global,
      file-level metadata.
  exclude_applied : bool
      For API compatibility. Currently ignored.
  
  Returns
  -------
  metadata : dict
      A dictionary with information regarding the tiff flavor (file-level)
      or tiff tags (page-level).
docstr_tok: ["Format-Specific","TIFF","metadata",".","The","metadata","returned","depends","on","the","value","of","both","``","index","``","and","``","page","``",".","``","index","``","selects","a","series","and","``","page","``","allows","selecting","a","single","page","from","the","selected","series",".","If","``","index=Ellipsis","``",",","``","page","``","is","understood","as","a","flat","index",",","i.e.",",","the","selection","ignores","individual","series","inside","the","file",".","If","``","index=Ellipsis","``","and","``","page=None","``","then","global","(","file-level",")","metadata","is","returned",".","Parameters","--","--","--","--","--","index",":","int","Select","the","series","of","which","to","extract","metadata","from",".","If","Ellipsis",",","treat","page","as","a","flat","index","into","the","file","'s","pages",".","page",":","int","If","not","None",",","select","the","page","of","which","to","extract","metadata","from",".","If","None",",","read","series-level","metadata","or",",","if","``","index=","...","``","global",",","file-level","metadata",".","exclude_applied",":","bool","For","API","compatibility",".","Currently","ignored",".","Returns","--","--","--","-","metadata",":","dict","A","dictionary","with","information","regarding","the","tiff","flavor","(","file-level",")","or","tiff","tags","(","page-level",")","."]
code: def metadata(
      self,
      *,
      index: int = Ellipsis,
      page: int = None,
      exclude_applied: bool = True,
  ) -> Dict[str, Any]:
      """Format-Specific TIFF metadata.
  
      The metadata returned depends on the value of both ``index`` and
      ``page``. ``index`` selects a series and ``page`` allows selecting a
      single page from the selected series. If ``index=Ellipsis``, ``page`` is
      understood as a flat index, i.e., the selection ignores individual
      series inside the file. If ``index=Ellipsis`` and ``page=None`` then
      global (file-level) metadata is returned.
  
      Parameters
      ----------
      index : int
          Select the series of which to extract metadata from. If Ellipsis, treat
          page as a flat index into the file's pages.
      page : int
          If not None, select the page of which to extract metadata from. If
          None, read series-level metadata or, if ``index=...`` global,
          file-level metadata.
      exclude_applied : bool
          For API compatibility. Currently ignored.
  
      Returns
      -------
      metadata : dict
          A dictionary with information regarding the tiff flavor (file-level)
          or tiff tags (page-level).
      """
  
      if index is not Ellipsis and page is not None:
          target = self._fh.series[index].pages[page]
      elif index is not Ellipsis and page is None:
          # This is based on my understanding that series-level metadata is
          # stored in the first TIFF page.
          target = self._fh.series[index].pages[0]
      elif index is Ellipsis and page is not None:
          target = self._fh.pages[page]
      else:
          target = None
  
      metadata = {}
      if target is None:
          # return file-level metadata
          metadata["byteorder"] = self._fh.byteorder
  
          for flag in tifffile.TIFF.FILE_FLAGS:
              flag_value = getattr(self._fh, "is_" + flag)
              metadata["is_" + flag] = flag_value
  
              if flag_value and hasattr(self._fh, flag + "_metadata"):
                  flavor_metadata = getattr(
                      self._fh, flag + "_metadata"
                  )
                  if isinstance(flavor_metadata, tuple):
                      metadata.update(flavor_metadata[0])
                  else:
                      metadata.update(flavor_metadata)
      else:
          # tifffile may return a TiffFrame instead of a page
          target = target.keyframe
  
          metadata.update({tag.name: tag.value for tag in target.tags})
          metadata.update(
              {
                  "planar_configuration": target.planarconfig,
                  "compression": target.compression,
                  "predictor": target.predictor,
                  "orientation": None,  # TODO
                  "description1": target.description1,
                  "description": target.description,
                  "software": target.software,
                  **_get_resolution(target),
                  "datetime": target.datetime,
              }
          )
  
      return metadata
  
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 5 for calling the TifffilePlugin obj's underlying member method code with example usage: obj.metadata() and returns: metadata