net.imagej.axis.CalibratedAxis Java Examples

The following examples show how to use net.imagej.axis.CalibratedAxis. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultImgUtilityService.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public long[] getConstrainedLengths(final Metadata m, final int imageIndex,
	final SCIFIOConfig config)
{
	final long[] lengths = getDimLengths(m, imageIndex, config);

	final ImageRegion r = config.imgOpenerGetRegion();

	if (r != null) {
		// set each dimension length = the number of entries for that axis
		for (final CalibratedAxis t : m.get(0).getAxes()) {
			final Range range = r.getRange(t.type());
			if (range != null) lengths[m.get(0).getAxisIndex(t)] = range.size();
		}
	}

	return lengths;
}
 
Example #2
Source File: DefaultDatasetIOService.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * The {@link DatasetService#create} methods make a best guess for populating
 * {@link Dataset} information. But this can be incorrect/over-aggressive,
 * e.g. in the case of RGBMerged state.
 * <p>
 * If we have access to the {@link Metadata} instance backing a
 * {@code Dataset}, we can use it to more accurately populate these settings.
 * </p>
 *
 * @param dataset Dataset instance to update.
 * @param imageMeta Metadata instance to query for updated information.
 */
private void updateDataset(final Dataset dataset,
	final ImageMetadata imageMeta)
{
	// If the original image had some level of merged channels, we should set
	// RGBmerged to true for the sake of backwards compatibility.
	// See https://github.com/imagej/imagej-legacy/issues/104

	// Look for Axes.CHANNEL in the planar axis list. If found, set RGBMerged to
	// true.
	boolean rgbMerged = false;

	for (final CalibratedAxis axis : imageMeta.getAxesPlanar()) {
		if (axis.type().equals(Axes.CHANNEL)) rgbMerged = true;
	}

	dataset.setRGBMerged(rgbMerged);
}
 
Example #3
Source File: MetadataUtil.java    From imagej-ops with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@SuppressWarnings("unchecked")
private static <C extends CalibratedAxis> void copyTypedSpace(
	final Interval inInterval, final CalibratedSpace<C> in,
	final CalibratedSpace<C> out)
{

	int offset = 0;
	for (int d = 0; d < in.numDimensions(); d++) {
		if (inInterval != null && inInterval.dimension(d) == 1) {
			offset++;
		}
		else {
			out.setAxis((C) in.axis(d).copy(), d - offset);
		}
	}
}
 
Example #4
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Computes and caches the effective (non-trailing-length-1 axes) axis types
 * for this dataset.
 */
private List<CalibratedAxis> getEffectiveAxes() {
	if (effectiveAxes == null && axes != null) {
		int end = axes.size();

		for (; end > getPlanarAxisCount(); end--) {
			final CalibratedAxis axis = axes.get(end - 1);
			if (getAxisLength(axis) > 1) {
				break;
			}
		}

		effectiveAxes = new ArrayList<>();
		for (int i = 0; i < end; i++) {
			effectiveAxes.add(axes.get(i));
		}
	}

	return effectiveAxes;
}
 
Example #5
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public void populate(final String name, final List<CalibratedAxis> axes,
	final long[] lengths, final int pixelType, final int bitsPerPixel,
	final boolean orderCertain, final boolean littleEndian,
	final boolean indexed, final boolean falseColor,
	final boolean metadataComplete)
{
	this.name = name;
	this.axes = new ArrayList<>(axes);
	setAxisLengths(lengths.clone());
	this.bitsPerPixel = bitsPerPixel;
	this.falseColor = falseColor;
	this.indexed = indexed;
	this.littleEndian = littleEndian;
	this.orderCertain = orderCertain;
	this.pixelType = pixelType;
}
 
Example #6
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public void setAxis(final int index, final CalibratedAxis axis) {
	final int oldIndex = getAxisIndex(axis);

	// Replace existing axis
	if (oldIndex < 0) {
		final long length = axisLengths.remove(axes.get(index).type());
		axes.remove(index);

		if (index == axes.size()) {
			axes.add(axis);
		}
		else {
			axes.add(index, axis);
		}
		axisLengths.put(axis.type(), length);
	}
	// Axis is already in the list. Move it here.
	else {
		axes.remove(axes.get(oldIndex));
		axes.add(index, axis);
	}

	clearCachedAxes();
}
 
Example #7
Source File: FormatTools.java    From scifio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/** Checks that the given tile size is valid for the given reader. */
public static void checkTileSize(final Metadata m, final Interval bounds,
	final int imageIndex) throws FormatException
{
	final List<CalibratedAxis> axes = m.get(imageIndex).getAxesPlanar();

	for (int i = 0; i < axes.size(); i++) {
		final long start = bounds.min(i);
		final long end = bounds.max(i);
		final long length = m.get(imageIndex).getAxisLength(axes.get(i));

		if (start < 0 || end < 0 || end >= length) {
			throw new FormatException("Invalid planar size: start=" + start +
				", end=" + end + ", length in metadata=" + length);
		}
	}
}
 
Example #8
Source File: FormatTools.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Creates an array, wrapping all provided AxisTypes as CalibratedAxis with
 * calibration = 1.0.
 */
public static CalibratedAxis[] createAxes(final AxisType... axisTypes) {
	final CalibratedAxis[] axes = new CalibratedAxis[axisTypes.length];

	for (int i = 0; i < axisTypes.length; i++) {
		axes[i] = createAxis(axisTypes[i]);
	}
	return axes;
}
 
Example #9
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public long getSize() {
	long size = 1;

	for (final CalibratedAxis a : getAxes()) {
		size = ArrayUtils.safeMultiply64(size, getAxisLength(a));
	}

	final int bytesPerPixel = getBitsPerPixel() / 8;

	return ArrayUtils.safeMultiply64(size, bytesPerPixel);
}
 
Example #10
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void setAxisTypes(final AxisType... axisTypes) {
	final CalibratedAxis[] axes = new CalibratedAxis[axisTypes.length];

	for (int i = 0; i < axisTypes.length; i++) {
		final AxisType t = axisTypes[i];
		CalibratedAxis c = getAxis(t);
		if (c == null) c = FormatTools.createAxis(t);
		axes[i] = c;
	}
	setAxes(axes);
}
 
Example #11
Source File: ManualReadImg.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void readImg(final File file) throws Exception {
	final ImgPlus<?> img = IO.open(new FileLocation(file.getAbsolutePath()));

	System.out.println("file = " + file);
	System.out.println("Dimensions:");
	for (int d = 0; d < img.numDimensions(); d++) {
		final CalibratedAxis axisType = img.axis(d);
		final long axisLength = img.dimension(d);
		System.out.println("\t" + axisLength + " : " + axisType.type()
			.getLabel());
	}
}
 
Example #12
Source File: StratecPQCTFormatTest.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testPopulateImageMetadata() throws Exception {
	// SETUP
	final Metadata metadata = (Metadata) format.createMetadata();
	final short width = 10;
	metadata.setWidth(width);
	final short height = 15;
	metadata.setHeight(height);
	final short slices = 5;
	metadata.setSlices(slices);
	final double resolution = 0.5;
	metadata.setResolution(resolution);
	final double distance = 0.1;
	metadata.setSliceDistance(distance);
	final CalibratedAxis[] expectedAxes = new CalibratedAxis[] {
		new DefaultLinearAxis(Axes.X, Metadata.UNIT, resolution),
		new DefaultLinearAxis(Axes.Y, Metadata.UNIT, resolution) };

	// EXERCISE
	metadata.populateImageMetadata();
	final ImageMetadata imgMeta = metadata.get(0);
	final List<CalibratedAxis> axes = imgMeta.getAxes();

	// VERIFY
	assertTrue(imgMeta.isLittleEndian());
	assertTrue(imgMeta.isOrderCertain());
	assertEquals(16, imgMeta.getBitsPerPixel());
	assertEquals(FormatTools.INT16, imgMeta.getPixelType());
	assertEquals(2, imgMeta.getPlanarAxisCount());
	assertEquals(width, imgMeta.getAxisLength(Axes.X));
	assertEquals(height, imgMeta.getAxisLength(Axes.Y));
	assertEquals(expectedAxes.length, axes.size());
	for (int i = 0; i < expectedAxes.length; i++) {
		final CalibratedAxis expected = expectedAxes[i];
		final CalibratedAxis axis = axes.get(i);
		assertEquals(expected.type(), axis.type());
		assertEquals(expected.unit(), axis.unit());
		assertEquals(expected.averageScale(0, 1), axis.averageScale(0, 1), 1e-12);
	}
}
 
Example #13
Source File: ScancoISQFormatTest.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testPopulateImageMetadata() throws Exception {
	// SETUP
	final ScancoISQFormat.Metadata metadata = (ScancoISQFormat.Metadata) format
		.createMetadata();
	final int[] dimensions = { 15, 14, 13 };
	final int[] physicalDimensions = { 45, 35, 20 };
	final double[] voxelDimensions = IntStream.range(0, 3).mapToDouble(
		i -> 1.0 * physicalDimensions[i] / dimensions[i]).toArray();
	metadata.setPhysicalWidth(physicalDimensions[0]);
	metadata.setPhysicalHeight(physicalDimensions[1]);
	metadata.setPhysicalDepth(physicalDimensions[2]);
	metadata.setWidth(dimensions[0]);
	metadata.setHeight(dimensions[1]);
	metadata.setSlices(dimensions[2]);
	metadata.populateImageMetadata();

	// EXECUTE
	final ImageMetadata imgMeta = metadata.get(0);

	// VERIFY
	assertTrue(imgMeta.isLittleEndian());
	assertTrue(imgMeta.isOrderCertain());
	assertEquals(16, imgMeta.getBitsPerPixel());
	assertEquals(FormatTools.INT16, imgMeta.getPixelType());
	assertEquals(2, imgMeta.getPlanarAxisCount());
	final List<CalibratedAxis> axes = imgMeta.getAxes();
	assertEquals(3, axes.size());
	for (int i = 0; i < 3; i++) {
		assertEquals(dimensions[i], imgMeta.getAxisLength(i));
		assertEquals(voxelDimensions[i], axes.get(i).averageScale(0, 1), 1e-12);
	}
}
 
Example #14
Source File: PlaneSeparator.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Converts the given plane information using the current metadata to a format
 * usable by the wrapped reader, stored in the "lastPlane"... variables.
 */
private void updateLastPlaneInfo(final long source, final int imageIndex,
	final int splitOffset, final Interval bounds)
{
	final Metadata meta = getMetadata();
	final Metadata parentMeta = getParentMeta();
	lastPlaneIndex = source;
	lastImageIndex = imageIndex;
	// create the plane offsets and lengths to match the underlying image
	lastPlaneMin = new long[bounds.numDimensions() + splitOffset];
	lastPlaneMax = new long[bounds.numDimensions() + splitOffset];

	// Create the offset and length arrays to match the underlying,
	// unsplit dimensions. This is required to pass to the wrapped reader.
	// The unsplit plane will then have the appropriate region extracted.
	for (final CalibratedAxis axis : parentMeta.get(imageIndex)
		.getAxesPlanar())
	{
		final int parentIndex = parentMeta.get(imageIndex).getAxisIndex(axis
			.type());
		final int currentIndex = meta.get(imageIndex).getAxisIndex(axis.type());
		// This axis is still a planar axis, so we can read it from the
		// current plane offsets/lengths
		if (currentIndex >= 0 && currentIndex < meta.get(imageIndex)
			.getPlanarAxisCount())
		{
			lastPlaneMin[parentIndex] = bounds.min(currentIndex);
			lastPlaneMax[parentIndex] = bounds.max(currentIndex);
		}
		// This axis is a planar axis in the underlying metadata that was
		// split out, so we will insert a [0,length] range
		else if (parentMeta.get(imageIndex).getAxisIndex(axis.type()) < parentMeta
			.get(imageIndex).getPlanarAxisCount())
		{
			lastPlaneMin[parentIndex] = 0;
			lastPlaneMax[parentIndex] = parentMeta.get(imageIndex).getAxisLength(
				axis.type()) - 1;
		}
	}
}
 
Example #15
Source File: DimensionSwapper.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
	 * Returns the order for reading AxisTypes from disk.
	 */
	public List<AxisType> getInputOrder(final int imageIndex) {
//		FormatTools.assertId(getCurrentFile(), true, 2);

		if (inputOrder == null) inputOrder = new ArrayList<>();
		final List<CalibratedAxis> axes = getMetadata().get(imageIndex).getAxes();

		for (int i = 0; i < axes.size(); i++) {
			inputOrder.set(i, axes.get(i).type());
		}

		return inputOrder;
	}
 
Example #16
Source File: TIFFFormat.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addDimensionalAxisInfo(final IFD ifd, final int imageIndex) {
	// NB: Add dimensional metadata to TIFF comment of first plane's IFD.
	final ImageMetadata imageMeta = getMetadata().get(imageIndex);

	// Special case axes for ImageJ 1.x compatibility.
	final CalibratedAxis cAxis = imageMeta.getAxis(Axes.CHANNEL);
	final CalibratedAxis zAxis = imageMeta.getAxis(Axes.Z);
	final CalibratedAxis tAxis = imageMeta.getAxis(Axes.TIME);

	// All axes, for N-dimensional support.
	// NB: Yes, this is a hacky list of parallel lists.
	// And yes, we assume that all axes have linear scale.
	// This is merely an interim solution until SCIFIO can
	// marshal and unmarshal axes in an extensible way.
	final List<CalibratedAxis> axes = imageMeta.getAxes();
	final String types = list(axes, a -> a.type().toString());
	final String lengths = list(axes, a -> "" + imageMeta.getAxisLength(a));
	final String scales = list(axes, a -> "" + a.averageScale(0, 1));
	final String units = list(axes, a -> replaceMu(a.unit()));

	final String comment = "" + //
		"SCIFIO=" + getVersion() + "\n" + //
		"axes=" + types + "\n" + //
		"lengths=" + lengths + "\n" + //
		"scales=" + scales + "\n" + //
		"units=" + units + "\n" + //
		"bitsPerPixel=" + imageMeta.getBitsPerPixel() + "\n" + //
		// NB: The following fields are for ImageJ 1.x compatibility.
		"images=" + imageMeta.getPlaneCount() + "\n" + //
		"channels=" + imageMeta.getAxisLength(cAxis) + "\n" + //
		"slices=" + imageMeta.getAxisLength(zAxis) + "\n" + //
		"frames=" + imageMeta.getAxisLength(tAxis) + "\n" + //
		"hyperstack=true\n" + //
		"mode=composite\n" + //
		"unit=" + replaceMu(axes.get(0).unit()) + "\n";
	ifd.putIFDValue(IFD.IMAGE_DESCRIPTION, comment);
}
 
Example #17
Source File: PreviewPane.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private String getText(final ImageMetadata meta,
	final List<CalibratedAxis> axes)
{
	String text = "";
	for (final CalibratedAxis axis : axes) {
		if (text.length() > 0) text += " x ";
		text += meta.getAxisLength(axis) + " " + axis.type().getLabel();
	}
	return text;
}
 
Example #18
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public CalibratedAxis getAxis(final AxisType axisType) {
	for (final CalibratedAxis axis : getAxes()) {
		if (axis.type().equals(axisType)) return axis;
	}
	return null;
}
 
Example #19
Source File: FormatTools.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Applies the given scale and origin to the provided {@link CalibratedAxis} ,
 * if it is a {@link LinearAxis}.
 *
 * @throws IllegalArgumentException if the axis is not a {@link LinearAxis}.
 */
public static void calibrate(final CalibratedAxis axis, final double scale,
	final double origin)
{
	if (!(axis instanceof LinearAxis)) {
		throw new IllegalArgumentException("Not a linear axis: " + axis);
	}
	final LinearAxis linearAxis = (LinearAxis) axis;
	linearAxis.setScale(scale);
	linearAxis.setOrigin(origin);
}
 
Example #20
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public long getPlaneCount() {
	long length = 1;

	for (final CalibratedAxis t : getAxesNonPlanar()) {
		length *= getAxisLength(t);
	}

	return length;
}
 
Example #21
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public long[] getAxesLengths(final List<CalibratedAxis> axes) {
	final long[] lengths = new long[axes.size()];

	for (int i = 0; i < axes.size(); i++) {
		lengths[i] = getAxisLength(axes.get(i));
	}

	return lengths;
}
 
Example #22
Source File: ImgOpener.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Populates the calibration units of the given {@link SCIFIOImgPlus}, using
 * the provided {@link Metadata}.
 */
private <T> void setCalibrationUnits(
	final SCIFIOImgPlus<T> imgPlus, final Metadata m, final int imageIndex)
{
	for (final CalibratedAxis axis : m.get(imageIndex).getAxes()) {
		final int index = imgPlus.dimensionIndex(axis.type());
		if (index >= 0) {
			imgPlus.axis(index).setUnit(axis.unit());
		}
	}
}
 
Example #23
Source File: SCIFIOMetadataTools.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Guesses at a reasonable default planar axis count for the given list of
 * dimensional axes.
 * <p>
 * The heuristic looks for the first index following both {@link Axes#X} and
 * {@link Axes#Y}. If the list does not contain both {@code X} and {@code Y}
 * then the guess will equal the total number of axes.
 * </p>
 */
public static int guessPlanarAxisCount(final List<CalibratedAxis> axes) {
	boolean xFound = false, yFound = false;
	int d;
	for (d = 0; d < axes.size(); d++) {
		if (xFound && yFound) break;
		final AxisType type = axes.get(d).type();
		if (type == Axes.X) xFound = true;
		else if (type == Axes.Y) yFound = true;
	}
	return d;
}
 
Example #24
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public int getAxisIndex(final AxisType axisType) {
	// Use effectiveAxes if possible. If not, default to axes.
	final List<CalibratedAxis> knownAxes = effectiveAxes == null ? axes
		: effectiveAxes;

	return getAxisIndex(axisType, knownAxes);
}
 
Example #25
Source File: SCIFIOMetadataTools.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Replaces the first values.length of the provided Metadata's planar axes
 * with the values.
 */
public static long[] modifyPlanar(final int imageIndex, final Metadata meta,
	final long... values)
{
	final AxisValue[] axes = new AxisValue[values.length];
	final List<CalibratedAxis> axisTypes = meta.get(imageIndex).getAxes();

	for (int i = 0; i < axes.length && i < axisTypes.size(); i++) {
		axes[i] = new AxisValue(axisTypes.get(i).type(), values[i]);
	}

	return modifyPlanar(imageIndex, meta, axes);
}
 
Example #26
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void addAxis(final CalibratedAxis axis, final long value) {
	if (axes == null) axes = new ArrayList<>();

	// See if the axis already exists
	if (!axes.contains(axis)) {
		axes.add(axis);
		clearCachedAxes();
	}

	updateLength(axis.type(), value);
}
 
Example #27
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void populate(final String name, final List<CalibratedAxis> axes,
	final long[] lengths, final int pixelType, final boolean orderCertain,
	final boolean littleEndian, final boolean indexed, final boolean falseColor,
	final boolean metadataComplete)
{
	populate(name, axes, lengths, pixelType, FormatTools.getBitsPerPixel(
		pixelType), orderCertain, littleEndian, indexed, falseColor,
		metadataComplete);
}
 
Example #28
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Searches the given list of axes for an axis of the given type, returning
 * the index of the first match.
 */
private int getAxisIndex(final AxisType axisType,
	final List<CalibratedAxis> axisList)
{
	if (axisList == null) return -1;
	int index = -1;
	for (int i = 0; index == -1 && i < axisList.size(); i++) {
		if (axisList.get(i).type().equals(axisType)) index = i;
	}

	return index;
}
 
Example #29
Source File: AbstractImageMetadata.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private List<CalibratedAxis> getAxisList(final boolean planar) {
	int index = -1;
	int end = -1;
	List<CalibratedAxis> axisList = null;

	if (planar) {
		if (planarAxes == null) planarAxes = new ArrayList<>();
		axisList = planarAxes;
		index = 0;
		end = getPlanarAxisCount();
	}
	else {
		if (extendedAxes == null) extendedAxes = new ArrayList<>();
		axisList = extendedAxes;
		index = getPlanarAxisCount();
		end = getAxes().size();
	}

	if (axisList.size() == 0) {
		synchronized (axisList) {
			if (axisList.size() == 0) {

				axisList.clear();

				int position = 0;
				for (; index < end; index++) {
					if (position <= axisList.size()) {
						axisList.add(getAxes().get(index));
						position++;
					}
					else {
						axisList.set(position++, getAxes().get(index));
					}
				}
			}
		}
	}

	return axisList;
}
 
Example #30
Source File: DefaultImgUtilityService.java    From scifio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Currently there are limits as to what types of Images can be saved. All
 * images must ultimately adhere to an, at most, five-dimensional structure
 * using the known axes X, Y, Z, Channel and Time. Unknown axes (U) can
 * potentially be handled by coercing to the Channel axis. For example, X Y Z
 * U C U T would be valid, as would X Y Z U T. But X Y C Z U T would not, as
 * the unknown axis can not be compressed with Channel. This method will
 * return true if the axes of the provided image can be represented with a
 * valid 5D String, and false otherwise.
 */
@Override
public <T extends RealType<T> & NativeType<T>> boolean isCompressible(
	final ImgPlus<T> img)
{

	final CalibratedAxis[] axes = new CalibratedAxis[img.numDimensions()];
	img.axes(axes);

	final long[] axisLengths = new long[5];
	final long[] oldLengths = new long[img.numDimensions()];

	img.dimensions(oldLengths);

	// true if this img contains an axis that will need to be compressed
	boolean foundUnknown = false;

	for (int i = 0; i < axes.length; i++) {
		final CalibratedAxis axis = axes[i];

		switch (axis.type().getLabel().toUpperCase().charAt(0)) {
			case 'X':
			case 'Y':
			case 'Z':
			case 'C':
			case 'T':
				break;
			default:
				if (oldLengths[i] > 1) foundUnknown = true;
		}
	}

	if (!foundUnknown) return false;

	// This ImgPlus had unknown axes of size > 1, so we will check to see if
	// they can be compressed
	final String dimOrder = guessDimOrder(axes, oldLengths, axisLengths);

	return (dimOrder != null);
}