Class TMADearrayer

java.lang.Object
qupath.imagej.detect.dearray.TMADearrayer

public class TMADearrayer extends Object
Static methods used by the TMA dearrayer plugin.
Author:
Pete Bankhead
  • Constructor Details

    • TMADearrayer

      public TMADearrayer()
  • Method Details

    • detectTMACoresFromBinary

      public static qupath.imagej.detect.dearray.TMADearrayer.TMAGridShape detectTMACoresFromBinary(ByteProcessor bp, double coreDiameterPx, int nHorizontal, int nVertical, Roi roi)
      Detect TMA cores from a (low-resolution) whole slide image that has been thresholded to give a binary image. Cores should be circular and arranged in a grid pattern, although this may be (slightly) rotated and some cores may be missing (but at least a few should be present in all rows / columns of the grid).
      Parameters:
      bp - - the TMA slide image, after thresholding.
      coreDiameterPx - - approximate diameter of a single TMA core, in pixels
      nHorizontal - - number of cores per row of the full grid
      nVertical - - number of cores per column of the full grid
      roi - - optional region of interest determining where cores should be found (may be useful if edge artifacts are problematic)
      Returns:
      Polygon in which points are arranged in order, row-by-row, starting from the top-left corner of the grid.
    • makeBinaryImage

      public static ByteProcessor makeBinaryImage(ImageProcessor ip, double coreDiameterPx, Roi roi, boolean isFluorescence)
      Make a binary image depicting (hopefully) the TMA cores. The diameter of each core, in pixels, is used to determine filter sizes: - for background estimation (morphological opening) - for morphological cleaning of the thresholded image The threshold itself is computed using the triangle method.
      Parameters:
      ip - - the TMA slide image - this should show cores as dark-on-light (or in colour). Fluorescence images may be inverted beforehand.
      coreDiameterPx - - typical diameter of a TMA core, given in pixels
      roi - - optionally null; everything outside the ROI will be set to zero.
      isFluorescence - - true if this is a fluorescence image, false if it is brightfield.
      Returns:
      ByteProcessor with detected regions having values 255, background having the value 0
    • fitCorePolygonToGrid

      public static Polygon fitCorePolygonToGrid(Polygon poly, double coreDiameterPx, int nHorizontal, int nVertical)
      Given a polygon representing TMA core centroids in any order, fit this to a coordinate grid. Essentially this amounts to sorting the points starting from the top left, continuing along each row. In practice the process is more complicated (and less certain to be correct...) because coordinates in the same TMA row cannot be trusted to occur with the same image y coordinate, similarly coordinates in the same TMA column can have different x coordinates.
      Parameters:
      poly - - The original centroid coordinates; this should have exactly nHorizontal * nVertical points.
      coreDiameterPx - - Approximate diameter of one TMA core (used to determine potential variability between core centroids)
      nHorizontal - - The number of cores in each row
      nVertical - - The number of cores in each column
      Returns:
      A polygon of TMA cores, with the order going from top-left, one row at a time. If the input polygon has the wrong number of points, null is returned.