Skip to content
Permalink
Browse files

Fix Manders' split coefficients wrong channel check bug

Manders' split coefficients were calculated correctly for the
ThresoldType.none  case - we see if the pixel is above thresold (zero)
in the OTHER channel .

However, for the .Aboive and .Below thresholdType cases, we were
checking if the pixel was above or below threshold in the SAME image
channel - that's wrong.

Now we check the correct channel, the other one.
As defined by Manders in the original article.
See coloc 2 wiki page.

This bug probably had a small impact as the thresholds of the two
channels tend to be rather similar and quite low.  The results wont
change much in the majority of situations. Only when the thresholds are
very different will be bug be very obvious.

Signed-off-by: daniel j. white <dan@chalkie.org.uk>
  • Loading branch information...
chalkie666 committed Aug 30, 2015
1 parent 5665600 commit e4a3a6ec36e0e878d40e1b1114f68deaccd41cde
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/algorithms/MandersColocalization.java
@@ -103,22 +103,22 @@ final boolean accecptCh2(T type1, T type2) {
acc = new MandersAccumulator(cursor) {
final boolean accecptCh1(T type1, T type2) {
return (type2.compareTo(zero) > 0) &&
(type1.compareTo(thresholdCh1) <= 0);
(type2.compareTo(thresholdCh2) <= 0);
}
final boolean accecptCh2(T type1, T type2) {
return (type1.compareTo(zero) > 0) &&
(type2.compareTo(thresholdCh2) <= 0);
(type1.compareTo(thresholdCh1) <= 0);
}
};
} else if (tMode == ThresholdMode.Above) {
acc = new MandersAccumulator(cursor) {
final boolean accecptCh1(T type1, T type2) {
return (type2.compareTo(zero) > 0) &&
(type1.compareTo(thresholdCh1) >= 0);
(type2.compareTo(thresholdCh2) >= 0);
}
final boolean accecptCh2(T type1, T type2) {
return (type1.compareTo(zero) > 0) &&
(type2.compareTo(thresholdCh2) >= 0);
(type1.compareTo(thresholdCh1) >= 0);
}
};
} else {

0 comments on commit e4a3a6e

Please sign in to comment.
You can’t perform that action at this time.