Java Code Examples for net.imglib2.util.Intervals#equalDimensions()

The following examples show how to use net.imglib2.util.Intervals#equalDimensions() . 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: MTKT.java    From imagej-ops with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public Double calculate(final RandomAccessibleInterval<T> image1, final RandomAccessibleInterval<U> image2) {
	// check image sizes
	// TODO: Add these checks to conforms().
	if (!(Intervals.equalDimensions(image1, image2))) {
		throw new IllegalArgumentException("Image dimensions do not match");
	}
	final long n1 = Intervals.numElements(image1);
	if (n1 > Integer.MAX_VALUE) {
		throw new IllegalArgumentException("Image dimensions too large: " + n1);
	}
	final int n = (int) n1;

	// compute thresholds
	final double thresh1 = threshold(image1);
	final double thresh2 = threshold(image2);

	double[][] rank = rankTransformation(image1, image2, thresh1, thresh2, n, seed);

	double maxtau = calculateMaxKendallTau(rank, thresh1, thresh2, n);
	return maxtau;
}
 
Example 2
Source File: MeshGeneratorJobManager.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(final Object obj)
{
	if (super.equals(obj))
		return true;

	if (obj instanceof SceneUpdateParameters)
	{
		final SceneUpdateParameters other = (SceneUpdateParameters) obj;

		if (rendererGrids.length != other.rendererGrids.length)
			return false;

		boolean sameBlockSize = true;
		for (int i = 0; i < rendererGrids.length; ++i)
		{
			sameBlockSize &= Intervals.equalDimensions(
					Grids.getCellInterval(rendererGrids[i], 0),
					Grids.getCellInterval(other.rendererGrids[i], 0));
		}

		return
				sameBlockSize &&
				simplificationIterations == other.simplificationIterations &&
				smoothingLambda == other.smoothingLambda &&
				smoothingIterations == other.smoothingIterations &&
				minLabelRatio == other.minLabelRatio;
	}

	return false;
}
 
Example 3
Source File: ColocUtil.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static boolean sameIterationOrder(Iterable<?> i1, Iterable<?> i2) {
	if (!(i1 instanceof IterableInterval) || !(i2 instanceof IterableInterval)) {
		return true;
	}
	IterableInterval<?> ii1 = (IterableInterval<?>) i1;
	IterableInterval<?> ii2 = (IterableInterval<?>) i2;
	return Intervals.equalDimensions(ii1, ii2) && Util.equalIterationOrder(ii1, ii2);
}
 
Example 4
Source File: CopyImg.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	if (out() != null) {
		return Intervals.equalDimensions(in(), out());
	}
	return true;
}
 
Example 5
Source File: CopyII.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	if (out() != null) {
		return Intervals.equalDimensions(in(), out());
	}
	return true;
}
 
Example 6
Source File: CopyImgLabeling.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	if (out() != null) {
		return Intervals.equalDimensions(in(), out())
				&& Util.getTypeFromInterval(in().getIndexImg()).getClass() == Util
						.getTypeFromInterval(out().getIndexImg())
						.getClass();
	}

	return true;
}
 
Example 7
Source File: WatershedBinary.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	boolean conformed = sigma.length >= in().numDimensions();
	for (int i = 0; i < sigma.length; i++) {
		conformed &= sigma[i] >= 0;
	}
	if (mask != null) {
		conformed &= Intervals.equalDimensions(mask, in());
	}
	return conformed;
}
 
Example 8
Source File: WatershedSeeded.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	boolean conformed = true;
	if (mask != null) {
		conformed = Intervals.equalDimensions(mask, in());
	}
	conformed &= Intervals.equalDimensions(seeds, in());
	return conformed;
}
 
Example 9
Source File: Watershed.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	if (mask != null) {
		return Intervals.equalDimensions(mask, in());
	}
	return true;
}
 
Example 10
Source File: WatershedBinarySingleSigma.java    From imagej-ops with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public boolean conforms() {
	boolean conformed = sigma >= 0;
	if (mask != null) {
		conformed &= Intervals.equalDimensions(mask, in());
	}
	return conformed;
}
 
Example 11
Source File: DefaultCCA.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean conforms() {
	if (out() == null) return true;
	return Intervals.equalDimensions(in(), out());
}
 
Example 12
Source File: MergeLabeling.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean conforms() {
	if (out() == null) return true;
	// TODO We could in future think about generalizing that scheme
	return Intervals.equalDimensions(in(), out());
}
 
Example 13
Source File: CopyRAI.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean conforms() {
	if (out() == null) return true;
	return Intervals.equalDimensions(in(), out());
}
 
Example 14
Source File: CopyArrayImg.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean conforms() {
	if (out() == null) return true;
	return Intervals.equalDimensions(in(), out());
}
 
Example 15
Source File: DefaultBilateral.java    From imagej-ops with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean conforms() {
	return (Intervals.equalDimensions(in(), out()));
}