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; } }