Package qupath.lib.regions
Class ImagePlane
java.lang.Object
qupath.lib.regions.ImagePlane
- All Implemented Interfaces:
Comparable<ImagePlane>
Helper class to store z-slice and time point indices, optionally along with a channel index as well.
These values are frequently required together, such as with ROIs
and RegionRequests
.
It is more convenient (and less error-prone) to use a single ImagePlane instance rather than passing the indices as
separate integers each time they are needed.
- Author:
- Pete Bankhead
-
Method Summary
Modifier and TypeMethodDescriptionint
Compare with another ImagePlane, in the order t, z, c.boolean
int
getC()
Get the channel index.static ImagePlane
Returns an ImagePlane with channel -1, z of 0 and t of 0.static ImagePlane
getPlane
(int z, int t) Returns an ImagePlus, where the z-slice and time point can be specified and channel is ignored (i.e.static ImagePlane
getPlane
(ImageRegion region) Returns an ImagePlane with channel -1 and z and t set from an existing ImageRegion.static ImagePlane
Returns an ImagePlane with channel -1, and z and t set from an existing ROI.static ImagePlane
getPlaneWithChannel
(int c, int z, int t) Returns an ImagePlane, where the channel, z-slice and time point can be specified.static ImagePlane
getPlaneWithChannel
(ROI roi) Returns an ImagePlane with channel, z and t set from an existing ROI.int
getT()
Get the time point index.int
getZ()
Get the z-slice index.int
hashCode()
toString()
-
Method Details
-
getC
public int getC()Get the channel index. This may be -1 to indicate no channel is specified.- Returns:
-
getZ
public int getZ()Get the z-slice index.- Returns:
-
getT
public int getT()Get the time point index.- Returns:
-
compareTo
Compare with another ImagePlane, in the order t, z, c.- Specified by:
compareTo
in interfaceComparable<ImagePlane>
-
toString
-
hashCode
public int hashCode() -
equals
-
getPlane
Returns an ImagePlus, where the z-slice and time point can be specified and channel is ignored (i.e. set to -1).- Parameters:
z
-t
-- Returns:
-
getDefaultPlane
Returns an ImagePlane with channel -1, z of 0 and t of 0.Use of this method is discouraged; it is appropriate only for 2D images.
- Returns:
-
getPlaneWithChannel
Returns an ImagePlane with channel, z and t set from an existing ROI.- Parameters:
roi
-- Returns:
-
getPlane
Returns an ImagePlane with channel -1, and z and t set from an existing ROI.- Parameters:
roi
-- Returns:
-
getPlane
Returns an ImagePlane with channel -1 and z and t set from an existing ImageRegion.- Parameters:
region
-- Returns:
-
getPlaneWithChannel
Returns an ImagePlane, where the channel, z-slice and time point can be specified.- Parameters:
c
-z
-t
-- Returns:
-