Migrating MutualInformation into ImgLib2 algorithm

Continuing the discussion from How to generate Similarity Index:

Hi @bogovicj,

I recently played around with your MutualInformation class (remember my comment on gitter and your reply?)

I still think it would be useful to have this in imglib2-algorithm.


When trying it (with some hand-drawn synthetic data, after inverting and adding noise), I noticed that MutualInformation.nmi() returned values slightly above 1. Isn’t normalized mutual information supposed to be between 0 and 1?

1 Like

Hi @imagejan,

Thanks for the poke again.

Isn’t normalized mutual information supposed to be between 0 and 1?

Indeed it is - looks like you found an issue. If its not too hard, maybe you could write out the contents of the histogram that’s produced as an intermediate step? Having an example that currently produces a wrong output would be really helpful!

I put a small amount of work into this about a week ago - added some tests and made the code a little more general. Let me push the dirty version of the code into a branch.

Will keep you posted here, :slight_smile:
John

2 Likes

Work in progress here, still quite rough

Fixed this in a new commit, and added some tests!

1 Like