* @param z the z-stack height index
* @param t the time index
* @return the index to the plane.
*/
static public int getIndex(Pixels pixels, int c, int z, int t) {
final DimensionOrder dimensionOrder = pixels.getDimensionOrder();
switch(dimensionOrder) {
case XYCTZ:
return c + pixels.getSizeC().getValue() * (t + pixels.getSizeT().getValue()*z);
case XYCZT:
return c + pixels.getSizeC().getValue() * (z + pixels.getSizeZ().getValue()*t);
case XYTCZ:
return t + pixels.getSizeT().getValue() * (c + pixels.getSizeC().getValue() * z);
case XYTZC:
return t + pixels.getSizeT().getValue() * (z + pixels.getSizeZ().getValue() * c);
case XYZCT:
return z + pixels.getSizeZ().getValue() * (c + pixels.getSizeC().getValue() * t);
case XYZTC:
return z + pixels.getSizeZ().getValue() * (t + pixels.getSizeT().getValue() * c);
}
throw new UnsupportedOperationException(String.format("Unsupported dimension order: %s", dimensionOrder.toString()));
}