From 04ed54ed84b66b3a59aff29ddeca17d071469845 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Mon, 4 Nov 2024 12:55:06 -0600 Subject: [PATCH] Fix immediate ClassCastExceptions --- .../roi/point/RealPointCollectionWrapper.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/imagej/legacy/convert/roi/point/RealPointCollectionWrapper.java b/src/main/java/net/imagej/legacy/convert/roi/point/RealPointCollectionWrapper.java index ea411417..5e689027 100644 --- a/src/main/java/net/imagej/legacy/convert/roi/point/RealPointCollectionWrapper.java +++ b/src/main/java/net/imagej/legacy/convert/roi/point/RealPointCollectionWrapper.java @@ -36,6 +36,7 @@ import net.imagej.legacy.convert.roi.MaskPredicateWrapper; import net.imglib2.RealLocalizable; import net.imglib2.RealPoint; +import net.imglib2.RealPositionable; import net.imglib2.roi.geom.real.WritableRealPointCollection; import net.imglib2.roi.util.RealLocalizableRealPositionable; import net.imglib2.roi.util.RealLocalizableRealPositionableWrapper; @@ -100,12 +101,12 @@ public void synchronize() { // -- Helper methods -- - private static float[] getCoors( - final WritableRealPointCollection rpc, + private static float[] getCoors( + final WritableRealPointCollection rpc, final int d) { final FloatArray coor = new FloatArray(); - final Iterator itr = rpc.points() + final Iterator itr = rpc.points() .iterator(); while (itr.hasNext()) coor.addValue(itr.next().getFloatPosition(d)); @@ -113,10 +114,10 @@ private static float[] getCoors( return coor.getArray(); } - private static int countPoints( - final WritableRealPointCollection rpc) + private static int countPoints( + final WritableRealPointCollection rpc) { - final Iterator itr = rpc.points() + final Iterator itr = rpc.points() .iterator(); int count = 0; while (itr.hasNext()) {