diff --git a/build.gradle b/build.gradle index 7767e24..2bd78fd 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ ext.qupathVersion = gradle.ext.qupathVersion description = 'QuPath extension to use Cellpose' -version = "0.9.4" +version = "0.9.5" dependencies { implementation "io.github.qupath:qupath-gui-fx:${qupathVersion}" diff --git a/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java b/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java index 9dd6ff2..7697196 100644 --- a/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java +++ b/src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java @@ -31,6 +31,7 @@ import org.bytedeco.opencv.opencv_core.Mat; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Geometry; +import org.locationtech.jts.geom.GeometryCollection; import org.locationtech.jts.index.strtree.STRtree; import org.locationtech.jts.simplify.VWSimplifier; import org.slf4j.Logger; @@ -609,14 +610,14 @@ private List filterDetections(Collection rawCa retainedObjects.add(currentCandidate); var envelope = envelopes.get(currentCandidate); - var overlaps = (List) tree.query(envelope); - for (var overlappingCandidate : overlaps) { + List overlaps = (List) tree.query(envelope); + for (CandidateObject overlappingCandidate : overlaps) { if (overlappingCandidate == currentCandidate || skippedObjects.contains(overlappingCandidate) || retainedObjects.contains(overlappingCandidate)) continue; // If we have an overlap, try to keep the largest object try { - /* + var env = envelopes.get(overlappingCandidate); if (envelope.intersects(env) && currentCandidate.geometry.intersects(overlappingCandidate.geometry)) { // Retain the nucleus only if it is not fragmented, or less than half its original area @@ -645,8 +646,6 @@ private List filterDetections(Collection rawCa skippedObjects.add(overlappingCandidate); } } - */ - skippedObjects.add(overlappingCandidate); } catch (Exception e) { skipErrorCount++;