Skip to content

Commit

Permalink
reverts touching object handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lacan committed Sep 2, 2024
1 parent 5996f0e commit 136b344
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/qupath/ext/biop/cellpose/Cellpose2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -609,14 +610,14 @@ private List<CandidateObject> filterDetections(Collection<CandidateObject> rawCa
retainedObjects.add(currentCandidate);
var envelope = envelopes.get(currentCandidate);

var overlaps = (List<CandidateObject>) tree.query(envelope);
for (var overlappingCandidate : overlaps) {
List<CandidateObject> overlaps = (List<CandidateObject>) 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
Expand Down Expand Up @@ -645,8 +646,6 @@ private List<CandidateObject> filterDetections(Collection<CandidateObject> rawCa
skippedObjects.add(overlappingCandidate);
}
}
*/
skippedObjects.add(overlappingCandidate);

} catch (Exception e) {
skipErrorCount++;
Expand Down

0 comments on commit 136b344

Please sign in to comment.