original_docstring: 
      An automatic image display function for all kinds of tensors. 
      The first image in batched images will be selected to be showed. 
      For medical images:
      Displacements with channel dimension identified will be displayed as RGB colored maps.
      If there are no dimension <=3, gray scaled images will be showed. 
      Transverse medical image with the right hand side of the subject shown on the left
          and anterior shown at the bottom will be selected for 3D volumes.
      `nslice` and `dim` are used for 3D volumes only, meaning to show the `nslice` slice of dimension `dim`. 
      
docstring: An automatic image display function for all kinds of tensors.
  The first image in batched images will be selected to be showed.
  For medical images:
  Displacements with channel dimension identified will be displayed as RGB colored maps.
  If there are no dimension <=3, gray scaled images will be showed.
  Transverse medical image with the right hand side of the subject shown on the left
  and anterior shown at the bottom will be selected for 3D volumes.
docstring_tokens: An automatic image display function for all kinds of tensors . The first image in batched images will be selected to be showed . For medical images : Displacements with channel dimension identified will be displayed as RGB colored maps . If there are no dimension < = 3 gray scaled images will be showed . Transverse medical image with the right hand side of the subject shown on the left and anterior shown at the bottom will be selected for 3D volumes .
code: def imshow(data: [Array, null]=None, nslice: [int, null]=None, dim: int=-1, **kwargs):
      """
      An automatic image display function for all kinds of tensors. 
      The first image in batched images will be selected to be showed. 
      For medical images:
      Displacements with channel dimension identified will be displayed as RGB colored maps.
      If there are no dimension <=3, gray scaled images will be showed. 
      Transverse medical image with the right hand side of the subject shown on the left
          and anterior shown at the bottom will be selected for 3D volumes.
      `nslice` and `dim` are used for 3D volumes only, meaning to show the `nslice` slice of dimension `dim`. 
      """
      global canvas
      has_cmap = True
      if 'cmap' not in kwargs:
          has_cmap = False
          kwargs['cmap'] = plt.cm.gray
      if data is not None: canvas = to_image(data, nslice, dim, has_cmap)
      if canvas is None or isinstance(canvas, tuple):
          raise TypeError("Please input data in 'imshow' or 'background' to show. ")
      return plt.imshow(canvas.numpy(), **kwargs)
code_tokens: def imshow ( data : [ Array , null ] = None , nslice : [ int , null ] = None , dim : int = - 1 , ** kwargs ) : global canvas has_cmap = True if 'cmap' not in kwargs : has_cmap = False kwargs [ 'cmap' ] = plt . cm . gray if data is not None : canvas = to_image ( data , nslice , dim , has_cmap ) if canvas is None or isinstance ( canvas , tuple ) : raise TypeError ( "Please input data in 'imshow' or 'background' to show. " ) return plt . imshow ( canvas . numpy ( ) , ** kwargs )
short_docstring: An automatic image display function for all kinds of tensors.
short_docstring_tokens: An automatic image display function for all kinds of tensors .
comment: """
      An automatic image display function for all kinds of tensors. 
      The first image in batched images will be selected to be showed. 
      For medical images:
      Displacements with channel dimension identified will be displayed as RGB colored maps.
      If there are no dimension <=3, gray scaled images will be showed. 
      Transverse medical image with the right hand side of the subject shown on the left
          and anterior shown at the bottom will be selected for 3D volumes.
      `nslice` and `dim` are used for 3D volumes only, meaning to show the `nslice` slice of dimension `dim`. 
      """