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
Modifier and TypeClassDescriptionstatic class
static enum
Enum representing the possible alignments for tiles. -
Method Summary
Modifier and TypeMethodDescriptionstatic Tiler.Builder
builder
(int tileSize) Create a new builder to generate square tiles.static Tiler.Builder
builder
(int tileWidth, int tileHeight) Create a new builder to generate rectangular tiles.static Tiler.Builder
Create a new builder initialized with the settings from an existing Tiler.createAnnotations
(ROI parent) Create a list ofPathAnnotationObject
tiles from the input.createGeometries
(Geometry parent) Create a list ofGeometry
tiles from the input.createObjects
(ROI parent, Function<ROI, PathObject> creator) Create a list ofPathObject
tiles from the input.createROIs
(ROI parent) Create a list ofROI
tiles from the input.createTiles
(ROI parent) Create a list ofPathTileObject
tiles from the input.Get the tiling alignment.boolean
Check if the tiler is set to crop the output to the input parent.boolean
Check if the tiler will filter the output based on whether the centroid of tiles lies within the parentint
Get the height of output tilesint
Get 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 ofGeometry
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
Create a list ofROI
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
Create a list ofPathObject
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 ofPathObject
- Returns:
- a list of tiles
-
createTiles
Create a list ofPathTileObject
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
Create a list ofPathAnnotationObject
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
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
-