code: def pftas(img, T=None):
      """
      values = pftas(img, T={mahotas.threshold.otsu(img)})
  
      Compute parameter free Threshold Adjacency Statistics
  
      TAS were presented by Hamilton et al.  in "Fast automated cell phenotype
      image classification" (https://www.biomedcentral.com/1471-2105/8/110)
  
      The current version is an adapted version which is free of parameters. The
      thresholding is done by using Otsu's algorithm (or can be pre-computed and
      passed in by setting `T`), the margin around the mean of pixels to be
      included is the standard deviation. This was first published by Coelho et
      al. in "Structured Literature Image Finder: Extracting Information from
      Text and Images in Biomedical Literature"
      (https://www.springerlink.com/content/60634778710577t0/)
  
      Also returns a version computed on the negative of the binarisation defined
      by Hamilton et al.
  
      Use tas() to get the original version of the features.
  
      Parameters
      ----------
      img : ndarray, 2D or 3D
          input image
      T : integer, optional
          Threshold to use (default: compute with otsu)
  
      Returns
      -------
      values : ndarray
          A 1-D ndarray of feature values
      """
      if T is None:
          T = otsu(img)
      pixels = img[img > T].ravel()
      if len(pixels) == 0:
          std = 0
      else:
          std = pixels.std()
      return _tas(img, T, std)
  
imports: import numpy
  from ..convolve import convolve
  from ..thresholding import otsu
label_desc: Use image node_id 3 for calling a global function with example usage: pftas(img, T) and returns: _tas