diff --git a/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java b/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java index 7f5970ee7..ac5da2ede 100644 --- a/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java +++ b/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java @@ -66,7 +66,7 @@ public void initialize() { @Override public RealMatrix calculate(final IterableRegion input) { final BlockRealMatrix output = new BlockRealMatrix(3, 3); - Cursor c = input.localizingCursor(); + Cursor c = input.inside().localizingCursor(); double[] pos = new double[3]; double[] computedCentroid = new double[3]; centroid.calculate(input).localize(computedCentroid); @@ -87,7 +87,7 @@ public RealMatrix calculate(final IterableRegion input) { output.setEntry(2, 1, output.getEntry(1, 2)); } - final double size = input.size(); + final double size = input.inside().size(); output.setEntry(0, 0, output.getEntry(0, 0) / size); output.setEntry(0, 1, output.getEntry(0, 1) / size); output.setEntry(0, 2, output.getEntry(0, 2) / size); diff --git a/src/main/java/net/imagej/ops/image/watershed/Watershed.java b/src/main/java/net/imagej/ops/image/watershed/Watershed.java index 57f66b4aa..4cf558690 100644 --- a/src/main/java/net/imagej/ops/image/watershed/Watershed.java +++ b/src/main/java/net/imagej/ops/image/watershed/Watershed.java @@ -137,7 +137,7 @@ public void compute(final RandomAccessibleInterval in, final ImgLabeling imiList = new ArrayList<>(); if (mask != null) { - final Cursor c = Regions.iterable(mask).localizingCursor(); + final Cursor c = Regions.iterable(mask).inside().localizingCursor(); while (c.hasNext()) { c.next(); imiList.add(IntervalIndexer.positionToIndex(c, in));