aliby.tile.tiler.Trap¶
- class Trap(centre, parent, size, max_size)[source]¶
Bases:
object
Stores a trap’s location and size. Allows checks to see if the trap should be padded. Can export the trap either in OMERO or numpy formats.
Methods
as_range
(tp)Return trap in a range format: two slice objects that can be used in arrays
as_tile
(tp)Return trap in the OMERO tile format of x, y, w, h where x, y are at the bottom left corner of the tile and w and h are the tile width and height.
at_time
(tp)Return trap centre at time tp by applying drifts
Methods
__init__
(centre, parent, size, max_size)as_range
(tp)Return trap in a range format: two slice objects that can be used in arrays
as_tile
(tp)Return trap in the OMERO tile format of x, y, w, h where x, y are at the bottom left corner of the tile and w and h are the tile width and height.
at_time
(tp)Return trap centre at time tp by applying drifts
- as_range(tp)[source]¶
Return trap in a range format: two slice objects that can be used in arrays
- Parameters
- tp: integer
Index for a time point
- Returns
- A slice of x coordinates from left to right
- A slice of y coordinates from top to bottom
- as_tile(tp)[source]¶
Return trap in the OMERO tile format of x, y, w, h where x, y are at the bottom left corner of the tile and w and h are the tile width and height.
- Parameters
- tp: integer
Index for a time point
- Returns
- x: int
x-coordinate of bottom left corner of tile
- y: int
y-coordinate of bottom left corner of tile
- w: int
Width of tile
- h: int
Height of tile