Interface Coords


public interface Coords
The multi-dimensional coordinate of a 2D image within a dataset.

This is typically used to represent the time point, stage position, z slice, and channel indices of images.

The Coords object is a mapping from axes (represented by strings) to positive integer indices. Because an arbitrary number of axes may be included in the Coords, the index zero is meaningless and will be omitted. Therefore, the axis index for any index not included in the Coords will be zero. The Coords of an image that is zero for all axes is an empty Coords.

The equals operator can be relied upon to establish whether two different Coords contain the same axes and the same indices to those axes.

Although methods are included to support any arbitrary axes, such usage is not yet fully supported. If you do use custom axes, give them names that include upper case letters so that they do not clash with standard axes added in the future.

Coords objects are immutable.

  • Field Details

  • Method Details

    • getIndex

      int getIndex(String axis)
      Get the index for the given axis.
      Parameters:
      axis - coordinate axis such as Coords.CHANNEL
      Returns:
      index along axis, or 0 if axis does not exist
    • getChannel

      int getChannel()
      Get the channel index.

      Equivalent to getIndex(Coords.CHANNEL).

      Returns:
      channel index, or 0 if this Coords doesn't contain a channel index.
    • getC

      int getC()
      Shorthand for getChannel.
      Returns:
      channel index, or 0 if this Coords doesn't contain a channel index.
    • getTimePoint

      int getTimePoint()
      Get the time point (frame) index.

      Equivalent to getIndex(Coords.TIME_POINT).

      Returns:
      time point index, or 0 if this Coords doesn't contain a time point index.
    • getTime

      @Deprecated int getTime()
      Deprecated.
      Due to looking like the physical time rather than an index. Use getTmePoint
      Same as getTimePoint.
      Returns:
      time index (0-based)
    • getT

      int getT()
      Shorthand for getTimePoint.
      Returns:
      time point index, or 0 if this Coords doesn't contain a time point index.
    • getZSlice

      int getZSlice()
      Get the Z slice index.

      Equivalent to getIndex(Coords.Z_SLICE).

      Returns:
      Z slice index, or 0 if this Coords doesn't contain a Z slice index.
    • getZ

      int getZ()
      Shorthand for getZSlice.
      Returns:
      Z slice index, or 0 if this Coords doesn't contain a Z slice index.
    • getStagePosition

      int getStagePosition()
      Get the stage position index.

      Equivalent to getIndex(Coords.STAGE_POSITION).

      Returns:
      stage position index, or 0 if this Coords doesn't contain a stage position index.
    • getP

      int getP()
      Shorthand for getStagePosition.
      Returns:
      stage position index, or 0 if this Coords doesn't contain a stage position index.
    • getAxes

      List<String> getAxes()
      Return all axes that this Coords has an index for.
      Returns:
      List of all axis
    • hasAxis

      boolean hasAxis(String axis)
      Returns whether this coords has the given axis.
      Parameters:
      axis - the axis to test for presence
      Returns:
      true if this coords includes axis
    • hasTimePointAxis

      boolean hasTimePointAxis()
    • hasT

      boolean hasT()
    • hasStagePositionAxis

      boolean hasStagePositionAxis()
    • hasP

      boolean hasP()
    • hasZSliceAxis

      boolean hasZSliceAxis()
    • hasZ

      boolean hasZ()
    • hasChannelAxis

      boolean hasChannelAxis()
    • hasC

      boolean hasC()
    • matches

      @Deprecated boolean matches(Coords alt)
      Deprecated.
      Use equality (after removing specific axes) instead
      Deprecated.
      Parameters:
      alt - the instance to compare with
      Returns:
      whether this instance is a superspace coords of other
    • copyBuilder

      Coords.Builder copyBuilder()
      Provides a Builder pre-loaded with a copy of this Coords.
      Returns:
      copyBuilder
    • copy

      Deprecated.
      Use copyBuilder instead
      Deprecated.
      Returns:
      Builder
    • copyRemovingAxes

      Coords copyRemovingAxes(String... axes)
      Removes the axes provided as varargs from this Coord.
      Parameters:
      axes - One or more Strings naming the axes to be removed
      Returns:
      Copy of this Coords without the listed axes
    • copyRetainingAxes

      Coords copyRetainingAxes(String... axes)
      Name of this function is very unclear. It seems that its functionality is to provide a copy of the given Coords, but only for the axes provided in the input strings. A more useful name may be: copyProvidedAxes, or copyAxes
      Parameters:
      axes - Names of axes to be represented in the output
      Returns:
      Copy of this Coords, but only with the subset of axes provided in the axes param