imagej / imagej-ops

ImageJ Ops: "Write once, run anywhere" image processing
https://imagej.net/libs/imagej-ops
BSD 2-Clause "Simplified" License
88 stars 42 forks source link

Add Maximum Truncated Kendall Tau (MTKT) Op #574

Closed etadobson closed 5 years ago

etadobson commented 6 years ago

This colocalization Op is based on the MTKT algorithm from Wang et al. (2017).

imagejan commented 6 years ago

How do you get the reference values for the tests? Also, assertEquals(double, double, double) should have a positive delta, not 0.0, no?

ctrueden commented 6 years ago

How do you get the reference values for the tests?

Empirically. They are regression tests, to ensure behavior does not change.

Also, assertEquals(double, double, double) should have a positive delta, not 0.0, no?

The idea is to fail the test if the known good value is not exactly the same as expected, hence the use of a zero delta.

I ran the unit tests on my macOS system in Eclipse, and everything passed.

But on Travis, we see these problems:

To make the P-value tests faster, you can use fewer iterations (e.g. 10 instead of 100), and/or use smaller images. I did not dig in to testMTKTPosCorr, so do not have advice about that.

In an effort to reproduce, I ran the tests on one of our Linux systems, and found different problems (!):

It is unfortunate that the behavior appears to be platform-specific. We will need to troubleshoot that.

One additional issue: MTKTTest.testMTKTpValueImage crops the big images to smaller images, so the test can run quickly. But the code surrounding the cropping is confusing and bears some simplification.

etadobson commented 6 years ago

I think the problem lies in the DefaultPValue class ... generating seeds for each thread. If thread # changes - the calculated values change in these tests as well. So it's not necessarily a Linux versus Mac issue - at least at the moment. I'm on it. thanks @ctrueden !!!

etadobson commented 5 years ago

I believe that this branch is ready to merge at this point... if folks don't mind taking another look - I'd appreciate it. 👍