Class ImagePlane

java.lang.Object
qupath.lib.regions.ImagePlane
All Implemented Interfaces:
Comparable<ImagePlane>

public class ImagePlane extends Object implements 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 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

      public int compareTo(ImagePlane o)
      Compare with another ImagePlane, in the order t, z, c.
      Specified by:
      compareTo in interface Comparable<ImagePlane>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getPlane

      public 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. set to -1).
      Parameters:
      z -
      t -
      Returns:
    • getDefaultPlane

      public static ImagePlane 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

      public static ImagePlane getPlaneWithChannel(ROI roi)
      Returns an ImagePlane with channel, z and t set from an existing ROI.
      Parameters:
      roi -
      Returns:
    • getPlane

      public static ImagePlane getPlane(ROI roi)
      Returns an ImagePlane with channel -1, and z and t set from an existing ROI.
      Parameters:
      roi -
      Returns:
    • getPlane

      public static ImagePlane getPlane(ImageRegion region)
      Returns an ImagePlane with channel -1 and z and t set from an existing ImageRegion.
      Parameters:
      region -
      Returns:
    • getPlaneWithChannel

      public static ImagePlane getPlaneWithChannel(int c, int z, int t)
      Returns an ImagePlane, where the channel, z-slice and time point can be specified.
      Parameters:
      c -
      z -
      t -
      Returns: