From 162a4f56795e4933343ded1f4a4207a09dd482bd Mon Sep 17 00:00:00 2001 From: Robert Haase Date: Tue, 11 Aug 2020 09:42:16 +0200 Subject: [PATCH] Bugfix: Co-occurrence matrices should be symmetric Otherwise, the direction of the read-out would play a role in further processing --- .../ops/image/cooccurrenceMatrix/CooccurrenceMatrix3D.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/imagej/ops/image/cooccurrenceMatrix/CooccurrenceMatrix3D.java b/src/main/java/net/imagej/ops/image/cooccurrenceMatrix/CooccurrenceMatrix3D.java index 66e65e4690..a26e6fe3c5 100644 --- a/src/main/java/net/imagej/ops/image/cooccurrenceMatrix/CooccurrenceMatrix3D.java +++ b/src/main/java/net/imagej/ops/image/cooccurrenceMatrix/CooccurrenceMatrix3D.java @@ -126,7 +126,8 @@ public double[][] calculate(final IterableInterval input) { && pixels[sz][sy][sx] != Integer.MAX_VALUE) { matrix[pixels[z][y][x]][pixels[sz][sy][sx]]++; - nrPairs++; + matrix[pixels[sz][sy][sx]][pixels[z][y][x]]++; + nrPairs += 2; } }