Skip to content

Commit

Permalink
Fix Manders' split coefficients wrong channel check bug
Browse files Browse the repository at this point in the history
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 e4a3a6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/algorithms/MandersColocalization.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e4a3a6e

Please sign in to comment.