Skip to content

Commit 136b344

Browse files
committed
reverts touching object handling
1 parent 5996f0e commit 136b344

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ext.qupathVersion = gradle.ext.qupathVersion
2525

2626
description = 'QuPath extension to use Cellpose'
2727

28-
version = "0.9.4"
28+
version = "0.9.5"
2929

3030
dependencies {
3131
implementation "io.github.qupath:qupath-gui-fx:${qupathVersion}"

src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.bytedeco.opencv.opencv_core.Mat;
3232
import org.locationtech.jts.geom.Envelope;
3333
import org.locationtech.jts.geom.Geometry;
34+
import org.locationtech.jts.geom.GeometryCollection;
3435
import org.locationtech.jts.index.strtree.STRtree;
3536
import org.locationtech.jts.simplify.VWSimplifier;
3637
import org.slf4j.Logger;
@@ -609,14 +610,14 @@ private List<CandidateObject> filterDetections(Collection<CandidateObject> rawCa
609610
retainedObjects.add(currentCandidate);
610611
var envelope = envelopes.get(currentCandidate);
611612

612-
var overlaps = (List<CandidateObject>) tree.query(envelope);
613-
for (var overlappingCandidate : overlaps) {
613+
List<CandidateObject> overlaps = (List<CandidateObject>) tree.query(envelope);
614+
for (CandidateObject overlappingCandidate : overlaps) {
614615
if (overlappingCandidate == currentCandidate || skippedObjects.contains(overlappingCandidate) || retainedObjects.contains(overlappingCandidate))
615616
continue;
616617

617618
// If we have an overlap, try to keep the largest object
618619
try {
619-
/*
620+
620621
var env = envelopes.get(overlappingCandidate);
621622
if (envelope.intersects(env) && currentCandidate.geometry.intersects(overlappingCandidate.geometry)) {
622623
// Retain the nucleus only if it is not fragmented, or less than half its original area
@@ -645,8 +646,6 @@ private List<CandidateObject> filterDetections(Collection<CandidateObject> rawCa
645646
skippedObjects.add(overlappingCandidate);
646647
}
647648
}
648-
*/
649-
skippedObjects.add(overlappingCandidate);
650649

651650
} catch (Exception e) {
652651
skipErrorCount++;

0 commit comments

Comments
 (0)