Class Tiler

java.lang.Object
qupath.lib.objects.utils.Tiler

public class Tiler extends Object
A class used to split ROI or Geometry objects into rectangular tiles. This is useful for breaking up large images into manageable pieces.

The Tiler is immutable and threadsafe.

Since:
v0.5.0
  • Method Details

    • getTileWidth

      public int getTileWidth()
      Get the width of output tiles
      Returns:
      the width in pixels
    • getTileHeight

      public int getTileHeight()
      Get the height of output tiles
      Returns:
      the height in pixels
    • getCropToParent

      public boolean getCropToParent()
      Check if the tiler is set to crop the output to the input parent.
      Returns:
      whether the tiler is set to crop output to the parent object
    • getAlignment

      public Tiler.TileAlignment getAlignment()
      Get the tiling alignment.
      Returns:
      The current setting
    • getFilterByCentroid

      public boolean getFilterByCentroid()
      Check if the tiler will filter the output based on whether the centroid of tiles lies within the parent
      Returns:
      The current setting
    • createGeometries

      public List<Geometry> createGeometries(Geometry parent)
      Create a list of Geometry tiles from the input. These may not all be rectangular based on the settings used.
      Parameters:
      parent - the object that will be split into tiles.
      Returns:
      a list of tiles
    • createROIs

      public List<ROI> createROIs(ROI parent)
      Create a list of ROI tiles from the input. These may not all be rectangular based on the settings used.
      Parameters:
      parent - the object that will be split into tiles.
      Returns:
      a list of tiles
    • createObjects

      public List<PathObject> createObjects(ROI parent, Function<ROI,PathObject> creator)
      Create a list of PathObject tiles from the input. These may not all be rectangular based on the settings used.
      Parameters:
      parent - the object that will be split into tiles.
      creator - a function used to create the desired type of PathObject
      Returns:
      a list of tiles
    • createTiles

      public List<PathObject> createTiles(ROI parent)
      Create a list of PathTileObject tiles from the input. These may not all be rectangular based on the settings used.
      Parameters:
      parent - the object that will be split into tiles.
      Returns:
      a list of tiles
    • createAnnotations

      public List<PathObject> createAnnotations(ROI parent)
      Create a list of PathAnnotationObject tiles from the input. These may not all be rectangular based on the settings used.
      Parameters:
      parent - the object that will be split into tiles.
      Returns:
      a list of tiles
    • builder

      public static Tiler.Builder builder(int tileSize)
      Create a new builder to generate square tiles.
      Parameters:
      tileSize - the width and height of the tiles, in pixels
      Returns:
      a new builder
    • builder

      public static Tiler.Builder builder(int tileWidth, int tileHeight)
      Create a new builder to generate rectangular tiles.
      Parameters:
      tileWidth - the width of the tiles, in pixels
      tileHeight - the height of the tiles, in pixels
      Returns:
      a new builder
    • builder

      public static Tiler.Builder builder(Tiler tiler)
      Create a new builder initialized with the settings from an existing Tiler. Because tilers are immutable, this is the only way to change the settings.
      Parameters:
      tiler - the tiler that provides initial settings
      Returns:
      a new builder