Closed JohnnyTeutonic closed 7 years ago
Okay, I included all your changes and also removed the unnecessary ravel functional calls (segA = np.ravel(gt), segB = np.ravel(seg)) at the beginning of the function, as I realised that the contingency table already flattens the input arrays anyway. So that removes some more redundant code.
As per discussion at https://github.com/cremi/cremi_python/issues/3#issuecomment-241711193 about errors with the normalisation of the Adapted Rand Errror, I have incorporated the changes to the ARE, adapted from the fixed code found in the above discussion, which is seen in the link: https://gist.github.com/thouis/63888c375cbeb2f702e94e2e82eebee8. The main change to the code is the removal of the division by 'n' , which previously had included division by both zero and non-zero pixels, which occurred when calculating the sum of the pixels in segments A and B. So now this code reflects only division by non-zero pixels, which is what should have been reflected in the reference implementation.