Skip to content

Commit 6fbfd67

Browse files
committed
Fix PolygonFeatureTests
1 parent 3598325 commit 6fbfd67

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/main/java/net/imagej/ops/geom/geom2d/DefaultMaximumFeretDiameter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import java.util.function.Function;
3232

33+
import net.imglib2.RealLocalizable;
3334
import net.imglib2.roi.geom.real.Polygon2D;
3435
import net.imglib2.type.numeric.real.DoubleType;
3536
import net.imglib2.util.Pair;
@@ -46,12 +47,10 @@
4647
@Parameter(key = "maxFeretsDiameter", itemIO = ItemIO.BOTH)
4748
public class DefaultMaximumFeretDiameter implements Computers.Arity1<Polygon2D, DoubleType> {
4849

49-
@SuppressWarnings("rawtypes")
5050
@OpDependency(name = "geom.maximumFeret")
51-
private Function<Polygon2D, Pair> maxFeret;
52-
@SuppressWarnings("rawtypes")
51+
private Function<Polygon2D, Pair<RealLocalizable, RealLocalizable>> maxFeret;
5352
@OpDependency(name = "geom.feretsDiameter")
54-
private Function<Pair, DoubleType> feretDiameter;
53+
private Function<Pair<RealLocalizable, RealLocalizable>, DoubleType> feretDiameter;
5554

5655
@Override
5756
public void compute(Polygon2D input, DoubleType output) {

src/main/java/net/imagej/ops/geom/geom2d/LabelRegionToPolygonConverter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@
3232
import java.lang.reflect.Type;
3333
import java.util.function.BiFunction;
3434

35+
import net.imglib2.RandomAccessibleInterval;
3536
import net.imglib2.roi.geom.real.Polygon2D;
3637
import net.imglib2.roi.labeling.LabelRegion;
38+
import net.imglib2.type.logic.BoolType;
3739

3840
import org.scijava.Priority;
3941
import org.scijava.convert.AbstractConverter;
4042
import org.scijava.convert.ConversionRequest;
4143
import org.scijava.convert.Converter;
4244
import org.scijava.ops.OpService;
43-
import org.scijava.ops.types.Nil;
4445
import org.scijava.ops.function.Functions;
46+
import org.scijava.ops.types.Nil;
4547
import org.scijava.plugin.Parameter;
4648
import org.scijava.plugin.Plugin;
4749

@@ -58,14 +60,13 @@ public class LabelRegionToPolygonConverter extends
5860
@Parameter
5961
private OpService ops;
6062

61-
//TODO can this LabelRegion be widened?
62-
private BiFunction<LabelRegion, Boolean, Polygon2D> contourFunc;
63+
private BiFunction<RandomAccessibleInterval<BoolType>, Boolean, Polygon2D> contourFunc;
6364

6465
@SuppressWarnings({ "unchecked" })
6566
@Override
6667
public <T> T convert(final Object src, final Class<T> dest) {
6768
if (contourFunc == null) {
68-
contourFunc = Functions.match(ops, "geom.contour", new Nil<LabelRegion>() {}, new Nil<Boolean>() {},
69+
contourFunc = Functions.match(ops, "geom.contour", new Nil<RandomAccessibleInterval<BoolType>>() {}, new Nil<Boolean>() {},
6970
new Nil<Polygon2D>() {});
7071
}
7172
// FIXME: can we make this faster?

src/test/java/net/imagej/ops/geom/PolygonFeatureTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import org.junit.BeforeClass;
4444
import org.junit.Test;
45-
import org.scijava.ops.core.builder.OpBuilder;
4645

4746
/**
4847
* Tests for polygon features.

0 commit comments

Comments
 (0)