public interface Coords
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.
Modifier and Type | Interface and Description |
---|---|
static interface |
Coords.Builder
The real Builder for Coords.
|
static interface |
Coords.CoordsBuilder
Not sure why there is a Builder and CoordsBuilder.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
C
Axis label for the channel axis (short form).
|
static java.lang.String |
CHANNEL
Axis label for the channel axis.
|
static java.lang.String |
P
Axis label for the stage position axis (short form).
|
static java.lang.String |
STAGE_POSITION
Axis label for the stage position axis.
|
static java.lang.String |
T
Axis label for the time point (frame) axis (short form).
|
static java.lang.String |
TIME
Deprecated.
Use discouraged because it reads like a physical time rather
than the time point index that it is.
|
static java.lang.String |
TIME_POINT
Axis label for the time point (frame) axis.
|
static java.lang.String |
Z
Axis label for the Z slice axis (short form).
|
static java.lang.String |
Z_SLICE
Axis label for the Z slice axis.
|
Modifier and Type | Method and Description |
---|---|
Coords.CoordsBuilder |
copy()
Deprecated.
Use
copyBuilder instead |
Coords.Builder |
copyBuilder()
Provides a Builder pre-loaded with a copy of this Coords.
|
Coords |
copyRemovingAxes(java.lang.String... axes)
Removes the axes provided as varargs from this Coord.
|
Coords |
copyRetainingAxes(java.lang.String... axes)
Name of this function is very unclear.
|
java.util.List<java.lang.String> |
getAxes()
Return all axes that this
Coords has an index for. |
int |
getC()
Shorthand for
getChannel . |
int |
getChannel()
Get the channel index.
|
int |
getIndex(java.lang.String axis)
Get the index for the given axis.
|
int |
getP()
Shorthand for
getStagePosition . |
int |
getStagePosition()
Get the stage position index.
|
int |
getT()
Shorthand for
getTimePoint . |
int |
getTime()
Deprecated.
Due to looking like the physical time rather than an index.
Use
getTmePoint |
int |
getTimePoint()
Get the time point (frame) index.
|
int |
getZ()
Shorthand for
getZSlice . |
int |
getZSlice()
Get the Z slice index.
|
boolean |
hasAxis(java.lang.String axis)
Returns whether this coords has the given axis.
|
boolean |
hasC() |
boolean |
hasChannelAxis() |
boolean |
hasP() |
boolean |
hasStagePositionAxis() |
boolean |
hasT() |
boolean |
hasTimePointAxis() |
boolean |
hasZ() |
boolean |
hasZSliceAxis() |
boolean |
matches(Coords alt)
Deprecated.
Use equality (after removing specific axes) instead
|
static final java.lang.String TIME_POINT
@Deprecated static final java.lang.String TIME
TIME_POINT
or T
.static final java.lang.String T
TIME_POINT
.static final java.lang.String STAGE_POSITION
static final java.lang.String P
STAGE_POSTITION
.static final java.lang.String Z_SLICE
static final java.lang.String Z
Z_SLICE
.static final java.lang.String CHANNEL
static final java.lang.String C
CHANNEL
.int getIndex(java.lang.String axis)
axis
- coordinate axis such as Coords.CHANNEL
axis
, or 0
if axis
does not
existint getChannel()
Equivalent to getIndex(Coords.CHANNEL)
.
0
if this Coords
doesn't
contain a channel index.int getC()
getChannel
.0
if this Coords
doesn't
contain a channel index.int getTimePoint()
Equivalent to getIndex(Coords.TIME_POINT)
.
0
if this Coords
doesn't
contain a time point index.@Deprecated int getTime()
getTmePoint
getTimePoint
.int getT()
getTimePoint
.0
if this Coords
doesn't
contain a time point index.int getZSlice()
Equivalent to getIndex(Coords.Z_SLICE)
.
0
if this Coords
doesn't
contain a Z slice index.int getZ()
getZSlice
.0
if this Coords
doesn't
contain a Z slice index.int getStagePosition()
Equivalent to getIndex(Coords.STAGE_POSITION)
.
0
if this Coords
doesn't contain a stage position index.int getP()
getStagePosition
.0
if this Coords
doesn't contain a stage position index.java.util.List<java.lang.String> getAxes()
Coords
has an index for.boolean hasAxis(java.lang.String axis)
axis
- the axis to test for presenceaxis
boolean hasTimePointAxis()
boolean hasT()
boolean hasStagePositionAxis()
boolean hasP()
boolean hasZSliceAxis()
boolean hasZ()
boolean hasChannelAxis()
boolean hasC()
@Deprecated boolean matches(Coords alt)
alt
- the instance to compare withother
Coords.Builder copyBuilder()
@Deprecated Coords.CoordsBuilder copy()
copyBuilder
insteadCoords copyRemovingAxes(java.lang.String... axes)
axes
- One or more Strings naming the axes to be removedCoords copyRetainingAxes(java.lang.String... axes)
axes
- Names of axes to be represented in the output