Package qupath.lib.objects.utils
Class Tiler
java.lang.Object
qupath.lib.objects.utils.Tiler
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumEnum representing the possible alignments for tiles. -
Method Summary
Modifier and TypeMethodDescriptionstatic Tiler.Builderbuilder(int tileSize) Create a new builder to generate square tiles.static Tiler.Builderbuilder(int tileWidth, int tileHeight) Create a new builder to generate rectangular tiles.static Tiler.BuilderCreate a new builder initialized with the settings from an existing Tiler.createAnnotations(ROI parent) Create a list ofPathAnnotationObjecttiles from the input.createGeometries(Geometry parent) Create a list ofGeometrytiles from the input.createObjects(ROI parent, Function<ROI, PathObject> creator) Create a list ofPathObjecttiles from the input.createROIs(ROI parent) Create a list ofROItiles from the input.createTiles(ROI parent) Create a list ofPathTileObjecttiles from the input.Get the tiling alignment.booleanCheck if the tiler is set to crop the output to the input parent.booleanCheck if the tiler will filter the output based on whether the centroid of tiles lies within the parentintGet the height of output tilesintGet the width of output tiles
-
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
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
Create a list ofGeometrytiles 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
Create a list ofROItiles 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
Create a list ofPathObjecttiles 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 ofPathObject- Returns:
- a list of tiles
-
createTiles
Create a list ofPathTileObjecttiles 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
Create a list ofPathAnnotationObjecttiles 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
Create a new builder to generate square tiles.- Parameters:
tileSize- the width and height of the tiles, in pixels- Returns:
- a new builder
-
builder
Create a new builder to generate rectangular tiles.- Parameters:
tileWidth- the width of the tiles, in pixelstileHeight- the height of the tiles, in pixels- Returns:
- a new builder
-
builder
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
-